Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
var _0xc751 = ["length", "digits", "boolean", "slice", "isNeg", "charAt", "-", "0", "substr", "abs", "", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "min", "charCodeAt", "max", "fromCharCode", " ", "join", "floor", "ceil", "modulus", "mu", "bkplus1", "modulo", "multiplyMod", "powMod", "NoPadding", "PKCS1Padding", "RawEncoding", "NumericEncoding", "number", "chunkSize", "radix", "barrett", "string", "random", "split", "substring", "lib", "Base", "prototype", "mixIn", "init", "hasOwnProperty", "apply", "$super", "extend", "toString", "WordArray", "words", "sigBytes", "stringify", "clamp", "push", "call", "clone", "enc", "Hex", "Latin1", "Utf8", "Malformed UTF-8 data", "parse", "BufferedBlockAlgorithm", "_data", "_nDataBytes", "concat", "blockSize", "_minBufferSize", "splice", "Hasher", "cfg", "reset", "finalize", "HMAC", "algo", "Base64", "_map", "indexOf", "create", "ABCDEFGHIJKLMN |
import React from 'react'; | |
const toPromise = (load) => (new Promise((resolve) => ( | |
load(resolve) | |
))); | |
class LazilyLoad extends React.Component { | |
constructor() { | |
super(...arguments); |
import React from 'react' | |
const bgStyles = { | |
strokeWidth: 3, | |
strokeLinejoin: 'round', | |
strokeLinecap: 'round', | |
fill: 'none', | |
stroke: '#c3fdff' | |
} |
if ( | |
process.env.NODE_ENV === 'production' && | |
window.__REACT_DEVTOOLS_GLOBAL_HOOK__ && | |
Object.keys(window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers).length | |
) { | |
window.__REACT_DEVTOOLS_GLOBAL_HOOK__._renderers = {} | |
} |
function LRU(limit) { | |
this.limit = limit || 1000; | |
this.map = new Map(); | |
} | |
LRU.prototype.has = function(key) { | |
return this.map.has(key); | |
} | |
LRU.prototype.set = function(key, value) { |
Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');
/* global fetch*/ | |
import {Dis, act} from 'disto'; | |
let {dispatch, register} = new Dis(); | |
function timeout(t){ | |
return new Promise(resolve => | |
setTimeout(()=> resolve(true), t)); | |
} |
// murmurhash2 via https://gist.github.com/raycmorgan/588423 | |
export default function doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { |
<!-- | |
This is a Microsoft Sysmon configuration to be used on Windows workstations | |
v0.2.1 December 2016 | |
Florian Roth (with the help and ideas of others) | |
The focus of this configuration is | |
- malware detection (execution) | |
- malware detection (network connections) | |
- exploit detection | |
It is not focussed on |
import Expedite from './'; | |
const getTest = async (testContext) => ({true: true, test: 'Hello World', testContext}); // pretend async thing thats not really | |
const pretendCreatePromise = ({uuid, name}) => Promise.resolve({uuid, name}); | |
export default class Test extends Expedite { | |
// req: express request object | |
// context: dependency injection (added at class initialise to avoid singletons) | |
async get(req, context) { // magically wrapped in try catch in the middleware, checks for this.error then defaults back to the next item in express | |
const res = await getTest(context); // database or whatever promise |