This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let out = 'create table some_table_name ('; | |
const fields = Object.keys(row); | |
for (var i = 0; i < fields.length; i++) { | |
const value = row[fields[i]]; | |
const originalType = typeof value; | |
let fieldType = 'unknown $originalType'; | |
switch (originalType) { | |
case 'string': | |
fieldType = 'varchar(255)'; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 [email protected] | |
/** | |
* You can pass in a random number generator object if you like. | |
* It is assumed to have a random() method. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var el=document.getElementById('docs-header');el.style.display= 'none';KX_kixApp.resize();return false; | |
Instructions: | |
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). | |
Issues: | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
'8':'backspace', | |
'9':'tab', | |
'13':'enter', | |
'16':'shift', | |
'17':'ctrl', | |
'18':'alt', | |
'19':'pause/break', | |
'20':'caps lock', | |
'27':'escape', |