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
//there are exceptions to the rule | |
{ | |
"property1" : "value1", | |
"property2" : "value2", | |
"property3" : ["value3.1","value3.2"] | |
} |
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
SELECT TRIM(TRAILING SUBSTR(value,NEW_LINE_INDEX-1) | |
FROM value) as NEW_VALUE | |
FROM ( | |
SELECT INSTR(value, "\n") | |
AS NEW_LINE_INDEX, | |
value | |
FROM table | |
WHERE value != "" | |
ORDER BY value | |
) findNewLines |
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
SELECT NEW_LINE_INDEX | |
FROM ( | |
SELECT INSTR(value, "\n") | |
AS NEW_LINE_INDEX | |
FROM table | |
WHERE value != "" | |
ORDER BY value | |
) findNewLines | |
WHERE NEW_LINE_INDEX > 0 | |
; |
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
var table = {}, cloth = {}; | |
table.clean = false; | |
cloth.clean = true; | |
// clean the table please | |
function wipeTable(cloth){ | |
console.log("cleaning table"); | |
if(cloth.clean){ | |
table.clean = 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
function log(message){ | |
if(window.console){ | |
console.log(message); | |
} | |
} | |
function warn(message){ | |
if(window.console){ | |
console.warn(message); | |
} |
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
// output a warning or message to the console | |
// depending on how the test passed | |
function assert(test, description){ | |
console[!!test ? 'log' : 'warn']('Test %s: returned %s', description, test); | |
} |
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
// i can't remember where I found this | |
// deep link to modal items | |
function deepLinkIntoModals() { | |
// queryStrip | |
function queryStrip(string) { | |
string = string.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]'); | |
var regex = new RegExp('[\\?&]' + string + '=([^&#]*)'), | |
results = regex.exec(location.search); | |
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, '')); |
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
// modified version of http://www.guffa.com/Programming_archive.aspx?id=16 | |
var getQuerystring = function (key, from){ | |
var re = new RegExp('(?:\\?|&)'+key+'=(.*?)(?=&|$)','gi') | |
, r = [] | |
, m | |
; | |
while ((m=re.exec(from)) != null) r.push(m[1]); | |
return (r.join(',') || '').replace('/',''); |
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
// https://stackoverflow.com/questions/31077319/regex-get-query-string-without-hash | |
var parseUri = function (uri){ | |
var anchor = document.createElement('a') | |
; | |
anchor.href = uri; | |
return { | |
protocol: anchor.protocol | |
, host: anchor.host | |
, hostname: anchor.hostname | |
, port: anchor.port |
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
application: you-app-name-here | |
version: 1 | |
runtime: python | |
api_version: 1 | |
default_expiration: "30d" | |
handlers: | |
- url: /(.*\.(appcache|manifest)) | |
mime_type: text/cache-manifest |