This file contains hidden or 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 tableColumnTotal(tableClassName,columnClassName){ | |
var columnIndexes = []; | |
var columnTotals = []; | |
//grab all tables | |
var tablesToInspect = document.getElementsByClassName(tableClassName); | |
//if tables found | |
if (tablesToInspect.length > 0){ | |
//loop thru tables |
This file contains hidden or 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
//defer until Modernizr is loaded. | |
$(function () { | |
/* HTML5 Input Placeholder Polyfill. */ | |
Modernizr.load({ | |
test: Modernizr.input.placeholder, | |
nope: [ | |
'/assets/css/placeholder_polyfill.min.css', | |
'/assets/js/placeholder_polyfill.jquery.min.combo.js' | |
] |
This file contains hidden or 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
// STRONG PASSWORD | |
// Must have capital letter, numbers and lowercase letters | |
var strongRegex = new RegExp("^(?=.{8,})(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*\\W).*$", "g"); | |
// MEDIUM PASSWORD | |
// Must have either capitals and lowercase letters or lowercase and numbers | |
var mediumRegex = new RegExp("^(?=.{7,})(((?=.*[A-Z])(?=.*[a-z]))|((?=.*[A-Z])(?=.*[0-9]))|((?=.*[a-z])(?=.*[0-9]))).*$", "g"); | |
// WEAK PASSWORD | |
// Must be at least 6 characters long |
This file contains hidden or 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
apt-get update | |
apt-get -y install rpcbind nfs-common | |
apt-get -y install libfontconfig | |
apt-get -y install git | |
wget http://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
tar -xvf phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
sudo mv phantomjs-1.9.1-linux-x86_64 /usr/local/src/phantomjs | |
rm phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs | |
phantomjs --version |
This file contains hidden or 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 setExternalAnchorTargets (targetBrowserWindow) { | |
var re = /^(https?:\/\/[^\/]+).*$/; | |
var currentHref = window.location.href.replace(re, '$1'); | |
var reLocal = new RegExp('^' + currentHref.replace(/\./, '\\.')); | |
var links = document.getElementsByTagName("a"); | |
for (var i = 0; i < links.length; i++) { | |
if (links[i].href == '' || reLocal.test(links[i].href) || !/^http/.test(links[i].href)){ | |
continue; | |
}else if (!links[i].target){ | |
links[i].target=targetBrowserWindow?targetBrowserWindow:"_BLANK"; |
This file contains hidden or 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
apt-get update | |
apt-get -y install libfontconfig | |
wget http://phantomjs.googlecode.com/files/phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
tar -xvf phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
sudo mv phantomjs-1.9.1-linux-x86_64 /usr/local/src/phantomjs | |
rm phantomjs-1.9.1-linux-x86_64.tar.bz2 | |
sudo ln -sf /usr/local/src/phantomjs/bin/phantomjs /usr/local/bin/phantomjs | |
phantomjs --version | |
cd /usr/local/src/ | |
sudo git clone git://github.com/n1k0/casperjs.git |
This file contains hidden or 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
#first line is the actual parser (DOM Hack) | |
var parser = document.createElement('a'); | |
#below are example usages | |
parser.href = "http://example-domain:1337/path/?search=query#anchor"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example-example.com" | |
parser.port; // => "1337" | |
parser.pathname; // => "/path/" | |
parser.search; // => "?search=query" |
This file contains hidden or 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
$datetime = strtotime("now"); | |
$mysqldate = date("m/d/y g:i A", $datetime); |
This file contains hidden or 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
curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash | |
nano ~/.bashrc | |
#insert into .bashrc | |
export RBENV_ROOT="${HOME}/.rbenv" | |
if [ -d "${RBENV_ROOT}" ]; then | |
export PATH="${RBENV_ROOT}/bin:${PATH}" | |
eval "$(rbenv init -)" | |
fi |
This file contains hidden or 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
sudo apt-get update | |
sudo apt-add-repository -y ppa:chris-lea/node.js | |
sudo apt-get install python-software-properties | |
sudo apt-get -y update | |
sudo apt-get -y install curl git-core nodejs |