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
if ( typeof String.prototype.endsWith !== 'function' ) { | |
String.prototype.endsWith = function( str ) { | |
return this.indexOf( str.toString(), this.length - str.length ) !== -1; | |
}; | |
} |
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
#! /usr/bin/env bash | |
# Variables | |
APPENV=local | |
DBHOST=localhost | |
DBNAME=dbname | |
DBUSER=dbuser | |
DBPASSWD=test123 | |
echo -e "\n--- Mkay, installing now... ---\n" |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<!-- | |
My coding philosophy | |
__ ___ _ _______ ________ ________ _____ __ ______ _____ _ __ _____ | |
\ \ / / | | | /\|__ __| ____\ \ / / ____| __ \ \ \ / / __ \| __ \| |/ // ____| | |
\ \ /\ / /| |__| | / \ | | | |__ \ \ / /| |__ | |__) | \ \ /\ / / | | | |__) | ' /| (___ | |
\ \/ \/ / | __ | / /\ \ | | | __| \ \/ / | __| | _ / \ \/ \/ /| | | | _ /| < \___ \ | |
\ /\ / | | | |/ ____ \| | | |____ \ / | |____| | \ \ \ /\ / | |__| | | \ \| . \ ____) | | |
\/ \/ |_| |_/_/ \_\_| |______| \/ |______|_| \_\ \/ \/ \____/|_| \_\_|\_\_____/ |
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
TYPE(Scope): Change Summary ( < 50-70 chars ) | |
Optional Message Body ( < 100 char lines ) | |
Multiple paragraphs are okay. | |
Bulleted lists: | |
* are | |
* also | |
* okay |
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
Math.round = (function() { | |
var originalRound = Math.round; | |
return function(number, precision) { | |
precision = Math.abs(parseInt(precision)) || 0; | |
var multiplier = Math.pow(10, precision); | |
return (originalRound(number * multiplier) / multiplier); | |
}; | |
})(); | |
/* | |
example usage: |
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 getObjectType(obj) { | |
if(obj===null)return "[object Null]"; // special case | |
return Object.prototype.toString.call(obj); | |
} |
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
img.grayscale { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); /* Firefox 10+, Firefox on Android */ | |
filter: gray; /* IE6-9 */ | |
-webkit-filter: grayscale(100%); /* Chrome 19+, Safari 6+, Safari 6+ iOS */ | |
} | |
img.grayscale.disabled { | |
filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); | |
-webkit-filter: grayscale(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
function getRootWebSitePath() { | |
var _location = document.location.toString(); | |
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3); | |
var applicationName = _location.substring(0, applicationNameIndex) + '/'; | |
var webFolderIndex = _location.indexOf('/', _ | |
location.indexOf(applicationName) + applicationName.length); | |
var webFolderFullPath = _location.substring(0, webFolderIndex); | |
return webFolderFullPath; | |
} |
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
<cfscript> | |
function convertQueryToStructArray( q ) { | |
var result = []; | |
for ( var row in arguments.q ) { | |
result.append( row ); | |
} | |
return result; | |
} |
OlderNewer