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
//Extend array function, remove matching values from array | |
Array.prototype.remove = function(delete_matching_values){ | |
var index = null; //store array index | |
//while loop through indexOf(delete_matching_values) values | |
do{ | |
index = this.indexOf(delete_matching_values); //return index of matching value | |
if(index > 0){ //if index if gt 0 remove | |
this.splice(index, 1); //remove values from array | |
} | |
} while(index > 0); |
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
touch README.md | |
git init | |
git add README.md | |
git commit -m "first commit" | |
git remote add origin https://github.com/-------.git | |
git push -u origin master | |
git remote add origin https://github.com/-------.git | |
git push -u origin master |
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
$(window).on 'scroll':-> | |
console.log($(window).scrollTop()) |
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
var app = $.sammy(function() { | |
// url: /#hello | |
this.get('#/hello', function() { | |
alert('hello world'); | |
}); | |
}); | |
$(function() { | |
app.run(); |
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
$('div').eq(0).load('/page/about.html .content'); |
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
//*from google code example | |
escapeHtml = function(text) { | |
if (text == null) { | |
return ''; | |
} | |
return text.replace(/&/g, '&'). | |
replace(/</g, '<'). | |
replace(/>/g, '>'). | |
replace(/"/g, '"'); | |
} |
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 rm -rf ~/Downloads/ | |
ln -s /Volumes/Bucket/Downloads/ ~/Downloads |
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
#Add read command to the end of your script. | |
echo "$( cd "$( dirname "$0" )" && pwd )" | |
read |
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
!!! 5 | |
html | |
head | |
meta(charset='utf-8') | |
meta(http-equiv='X-UA-Compatible', content='IE=edge') | |
title index | |
meta(name='description', content='') | |
meta(name='viewport', content='width=device-width, initial-scale=1') | |
link(rel='stylesheet', href='/main.css') | |
script(src='/frameworks.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
(function bars_stacked(container, horizontal) { | |
var | |
d1 = [], | |
d2 = [], | |
d3 = [], | |
graph, i; | |
for (i = 0; i < 4; i++) { | |
if (horizontal) { |
OlderNewer