tripu's notebooks

  • Origin 2 - /tripu/origin-2
    Last edited 4 days ago
    exports.endpoint = (request, response) => { response.end(`<h1>Origin 1</h1> <p>This link will redirect you to <code>https://www.ietf.org/</code>:</p> <a href="https://codepen.io/tripu/full/WNNJJbP"> <code>https://codepen.io/tripu/full/WNNJJbP</code> </a>`); };
  • Origin 1 - /tripu/origin-1
    Last edited 4 days ago
    exports.endpoint = (request, response) => { response.end(`<h1>Origin 1</h1> <p>This link will redirect you to <code>https://www.ietf.org/</code>:</p> <a href="https://codepen.io/tripu/full/WNNJJbP"> <code>https://codepen.io/tripu/full/WNNJJbP</code> </a>`); };
  • Redirect depending on referrer - /tripu/redirect-depending-on-referrer
    Last edited 4 days ago
    exports.endpoint = (request, response) => { response.end(`<script> const ref = document.referrer; const redirect = url => { window.alert(\`You will be redirected to\n${url}\`); window.location.href = url; }; if (-1 !== ref.indexOf('WNNJJrm') || -1 !== ref.indexOf('slack.com')) redirect('https://www.iana.org/'); else if (-1 !== ref.indexOf('NWWMMGe') || -1 !== ref.indexOf('google.com')) redirect('https://www.ietf.org/'); else window.alert(\`Unknown referrrer\n(${ref})\`); </script>`); };
  • Connecting to IRC from Node.js - /tripu/connecting-to-irc-from-node-js
    Last edited 2 years ago
    const irc = require('irc'); const config = { realName: 'Test; cf https://runkit.com/tripu/5914592a8518d10011506236', channels: ['#test'] }; const client = new irc.Client('irc.w3.org', 'tripu-bot', config); if (client) { client.addListener('error', (err) => console.debug(err)); client.addListener('registered', () => client.say('#test', "Hi! I'm alive!")); }