Skip to content

Instantly share code, notes, and snippets.

View hzoo's full-sized avatar
🌱
outside

Henry hzoo

🌱
outside
View GitHub Profile
@hzoo
hzoo / twitchfilter.js
Last active August 29, 2015 13:56
TwitchPlaysPokemon chat filter
//here's a cleaner version. same functionality
//just easier to change since the regex is at the beginning of the code.
//help from /u/BBQCalculator
//http://www.regexper.com/
//http://regexpal.com/
//modfied from a lot of others
//moved regex to top for simple pasting if it needs to change
var REGEX = /^((up|down|left|right|a|b|start|select|anarchy|democracy)\d*)+$/i;
@hzoo
hzoo / removeLowRank.js
Last active August 29, 2015 14:00
Delicious - remove low link rank sites
//selects all links in delicious page with link rank <= var for deletion
var minimumLinkRank = 10;
clearInterval(scroll);
var scroll = window.setInterval(function() {
window.scrollTo(0,document.body.scrollHeight);
}, 5000);
var feedList = document.querySelector('.link-list');
var historyLength = feedList.children.length;
@hzoo
hzoo / urf.ahk
Created June 21, 2014 23:58
auto press spells for URF mode (use `, f6,f7,f8,f9,f10)
#NoEnv
#singleInstance, Force
#InstallKeybdHook
#MaxThreadsPerHotkey, 2
#Persistent
#UseHook
SendMode Input
CoordMode,ToolTip,Screen
SetBatchLines, -1
@hzoo
hzoo / .jscsrc
Created October 11, 2014 01:15
jscs functions
{
"disallowSpacesInFunctionDeclaration": {
"beforeOpeningRoundBrace": true
},
"disallowSpacesInNamedFunctionExpression": {
"beforeOpeningRoundBrace": true
},
"requireSpacesInAnonymousFunctionExpression": {
"beforeOpeningRoundBrace": true,
"beforeOpeningCurlyBrace": true
@hzoo
hzoo / gist:1c9c8443b7e495f63a8d
Created November 18, 2014 02:03
some jsdoc types
@param
!Array.<string>=
!string
(object)=
(Object|Array)=
(Object|function(Object))=
*
...(Function)
...Object
@hzoo
hzoo / toggleRTL.js
Created February 25, 2015 14:24
Bookmarklet to toggleRTL (also adds rtl class to body)
(function() {
var body = $("body");
var dir = body.css("direction");
if (dir === "") {
body.css("direction", "rtl");
body.toggleClass('rtl');
} else if (dir === "ltr") {
body.css("direction", "rtl");
} else {
body.css("direction", "ltr");
@hzoo
hzoo / flow-examples.js
Last active November 2, 2017 21:40
Flow
// Flow Type Examples
// https://github.com/babel/babel/blob/65a44a1e131c8bc336b218991bae7548176de283/src/babel/types/alias-keys.json#L79-L110
// https://github.com/babel/babel/blob/088846a3479375a51d71084cb4fd70ef8fa21d29/src/babel/generation/generators/flow.js
/// Primitives
// AnyTypeAnnotation
var x : any;
// BooleanTypeAnnotation
var x : bool;
// part of t.VISITOR_KEYS;
var visitorKeysMap = {
// Others
"ArrayPattern": ["elements", "typeAnnotation"],
"ClassDeclaration": ["id", "body", "superClass", "typeParameters", "superTypeParameters", "implements", "decorators"],
"ClassExpression": ["id", "body", "superClass", "typeParameters", "superTypeParameters", "implements", "decorators"],
"FunctionDeclaration": ["id", "params", "body", "returnType", "typeParameters"],
"FunctionExpression": ["id", "params", "body", "returnType", "typeParameters"],
"Identifier": ["typeAnnotation"],
"ObjectPattern": ["properties", "typeAnnotation"],
var headings = {
"gen":["The Creation of the World","The Seventh Day, God Rests<br />The Creation of Man and Woman","The Fall","Cain and Abel","Adam's Descendants to Noah","Increasing Corruption on Earth<br />Noah and the Flood","Noah and the Flood (cont.)","The Flood Subsides<br />God's Covenant with Noah","God's Covenant with Noah (cont.)<br />Noah's Descendants","Nations Descended from Noah","The Tower of Babel<br />Shem's Descendants<br />Terah's Descendants","The Call of Abram<br />Abram and Sarai in Egypt","Abram and Lot Separate","Abram Rescues Lot<br />Abram Blessed by Melchizedek","God's Covenant with Abram","Sarai and Hagar","Abraham and the Covenant of Circumcision<br />Isaac's Birth Promised","Isaac's Birth Promised (cont.)<br />Abraham Intercedes for Sodom","God Rescues Lot<br />God Destroys Sodom<br />Lot and His Daughters","Abraham and Abimelech","The Birth of Isaac<br />God Protects Hagar and Ishmael<br />A Treaty with Abimelech","The Sacrifice of Isaac","Sarah's Death and Burial","Isaac and R
@hzoo
hzoo / tests.txt
Created May 31, 2015 14:02
babel-eslint - failing tests
3846 passing (5s)
88 failing
1) brace-style with (foo) {
bar();
}:
AssertionError: Should have no errors but had 1: [ { fatal: true,
severity: 2,
message: '\'with\' in strict mode',
line: 1,