View subreddit-face-average.js
import * as fs from "fs";
import * as path from "path";
import * as url from "url";
import { exec } from "child_process";
import cuid from "cuid";
import snoowrap from "snoowrap";
import throat from "throat";
import mmm from "mmmagic";
import axios from "axios";
View devtools-protocol-websocket-example.js
const devtools = new WebSocket('ws://localhost:9222/devtools/page/69990451-aaab-4ef8-87b1-ea77b8101b2a');
devtools.onmessage = ({data}) => {
const {result: {result: {value}}} = JSON.parse(data);
console.log('WebSocket Message Received: ', value)
};
devtools.send(JSON.stringify({
id: 1,
method: 'Runtime.evaluate',
View server-timing-example.js
const http = require('http');
function requestHandler(request, response) {
const headers = {
'Server-Timing': `
lb=18; "Load Balancer",
server-3=104; "Server #3 Startup",
db-read=187; "Database Read",
aws-download=317; "AWS Content Download",
db-write=218; "Database Write",
View highlight_tweets.js
(function(){
'use strict';
let cap = 100; // 100+ RTs or hearts produces max yellow bg color
$('.tweet', '.stream-items').each((i, tweet) => {
let all_nums = $(tweet)
.find('.ProfileTweet-actionList .ProfileTweet-actionCount:visible')
.map((j, elem) => Number(elem.textContent)).toArray();
View taxi.sh
#!/bin/sh
for i in trip_data_*.csv.zip
do
unzip -c $i
done |
tr -d '\015' |
awk -F, '{print $12 "," $11 " 1:0"; print $14 "," $13 " 1:1"}' |
/data2/data/github/datamaps/encode -z19 -m1 -o nyc-taxi-all
View lol.js
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
View functional-utils.js
const combine = (...arrays)
=> [].concat(...arrays);
const compact = arr
=> arr.filter(el => el);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
)();
View keybase.md

Keybase proof

I hereby claim:

  • I am umaar on github.
  • I am umaar (https://keybase.io/umaar) on keybase.
  • I have a public key whose fingerprint is 8D22 FAC6 0CE3 6C2A F52A F55D ECE8 0641 2622 7FB5

To claim this, I am signing this object:

View bubbles-canvas.js
// called once, to initialize
createBubbles: function(){
var self = this,
el = this.element,
width = $(window).width(),
height = $(window).height(),
canvas = document.createElement('canvas');
el.style.width = canvas.width = width;
el.style.height = canvas.height = height;
View webdriver-hover.js
/*
* Hover over an element on the page
*/
(function() {
"use strict";
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().usingServer().withCapabilities({'browserName': 'chrome' }).build();