Skip to content

Instantly share code, notes, and snippets.

RobKohr / perlin-noise-classical.js
Created Aug 23, 2011 — 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)
View perlin-noise-classical.js
// Ported from Stefan Gustavson's java implementation
// Read Stefan's excellent paper for details on how this code works.
// Sean McCullough
* You can pass in a random number generator object if you like.
* It is assumed to have a random() method.
View is_substr.php
/*return true if needle (string) is in haystack (string)*/
function is_substr($needle, $haystack){
$pos = strpos($haystack, $needle);
if ($pos === false) {
return false;
} else {
return true;
RobKohr / SlimDocs.js
Created Dec 22, 2010
Bookmarklet to remove unnecessary headers from a google doc view
View SlimDocs.js
javascript:var el=document.getElementById('docs-header'); 'none';KX_kixApp.resize();return false;
Create a new bookmark in your browser with whatever name you like, and copy the above as the url. When you are viewing a google doc click the bookmark and it will collapse the pointless junk at the top (everything above the menu bar).
Only works on word docs, not on spreadsheets (which will collapse the top, but the bottom won't extend down). Only tested on documents and spreadsheets.
Feel free to offer any fixes to get spreadsheets to work.
View javascript keycode to keyname translation table in json (not really ascii).js
'20':'caps lock',