Skip to content

Instantly share code, notes, and snippets.

View zz85's full-sized avatar

Joshua Koo zz85

View GitHub Profile
@zz85
zz85 / gist:069b2c1662f20a9ab3a1cc1e97b28ad1
Created July 22, 2022 23:35 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
@zz85
zz85 / pootify.js
Last active August 29, 2015 14:06 — forked from alisaifee/pootify.js
Pootify Bookmarklet
// TODO Use the DOM Mutation API!
(function switchText(node) {
var nodes = node.childNodes;
for (var n = 0; n < nodes.length; n++) {
if (nodes[n].nodeName.match(/(script|style)/i)); else
if (nodes[n].nodeType == 3) {
if (!/^\s+$/.test(nodes[n].value)) {
nodes[n].data = nodes[n].data.replace(/[a-zA-Z]+/g, function(w) {
return (w.match(/^(the|on|are|if|is|and|or|you|your|a|an)$/i))
? w
@zz85
zz85 / in_words.js
Last active December 14, 2015 08:29 — forked from bcamarda/in_words.js
Now support up to 999 trillion. (fixed a flooring error with ~~ and removed unneeded console.log)
// Converts a number to english words
// Based on https://gist.github.com/bcamarda/3001102
// Refactored and made some changes to support numbers to a hundred (US) trillion
// github.com/zz85
var inWords = (function() {
var numberHash = {
0:"", 1:"one", 2:"two", 3:"three", 4: "four", 5: "five", 6: "six", 7: "seven", 8: "eight", 9: "nine", 10: "ten",
@zz85
zz85 / LICENSE.txt
Created December 2, 2011 10:25 — forked from mirceapricop/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@zz85
zz85 / perlin-noise-classical.js
Created September 13, 2011 15:37 — forked from banksean/perlin-noise-classical.js
two Perlin noise generators in javascript. The simplex version is about 10% faster (in Chrome at least, haven't tried other browsers)
// Ported from Stefan Gustavson's java implementation
// http://staffwww.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf
// Read Stefan's excellent paper for details on how this code works.
//
// Sean McCullough banksean@gmail.com
/**
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
*/