Skip to content

Instantly share code, notes, and snippets.

@williammalo
williammalo / LICENSE.txt
Created March 22, 2012 12:45 — forked from tsaniel/LICENSE.txt
Fisher–Yates shuffle
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
@williammalo
williammalo / README.md
Created March 23, 2012 19:22
Determine if a value is in a array

This is a fork of a function by MathRobin. It's a bit longer, but it's made to work in older browsers that don't support indexOf.

@williammalo
williammalo / README.md
Last active October 2, 2015 06:18 — forked from 140bytes/LICENSE.txt
vendorPrefixr

Adds vendor prefix when needed.

Thanks to Evghenusi for minification tips

@williammalo
williammalo / README.md
Last active October 2, 2015 09:47 — forked from 140bytes/LICENSE.txt
MathGlobalizr

A function to get rid of the stupid "Math" object once and for all!

It allows this sort of syntax:

 myVariable = floor(myVariable)
 myOtherVariable = random()
@williammalo
williammalo / README.md
Last active October 2, 2015 11:49 — forked from 140bytes/LICENSE.txt
file Size Unit Calculator

This is a function to calculate the appropriate unit to describe a file size. If you want a fancier function, try this function: https://gist.github.com/2202887 by @vitronprince

Thanks to maettig for minification tips.

@williammalo
williammalo / README.md
Last active October 2, 2015 12:08 — forked from 140bytes/LICENSE.txt
Check if canvas pixel is black

This function checks if a canvas pixel is black.

This is very useful for making pixel-perfect collisions in a javascript game.

argument x and y are for the coordinates of said pixel.

argument c is for the canvas context.

@williammalo
williammalo / README.md
Last active October 2, 2015 16:47 — forked from 140bytes/LICENSE.txt
print time

Returns a string that formats time in a smart manner. If minutes is lower than 10, prepend a "0" to the minutes. If hours is in the afternoon, convert it to PM mode.

Thanks to xpansive for minification tips.

@williammalo
williammalo / README.md
Last active October 2, 2015 16:48 — forked from 140bytes/LICENSE.txt
paralaxr

Add parallax scrolling to a page's background.

@williammalo
williammalo / README.md
Last active October 2, 2015 22:47 — forked from 140bytes/LICENSE.txt
Draw mandelbrot fractal on canvas

Draws a mandelbrot fractal on a canvas.

usage:

mandelbrot(imageData,width)

Thanks to @atk for doing most of the minification work!

@williammalo
williammalo / README.md
Last active October 3, 2015 01:37 — forked from 140bytes/LICENSE.txt
number splitter

Splits numbers with commas to make them more readable. Thanks to @maettig for being awesome