Skip to content

Instantly share code, notes, and snippets.

@carlosmarte
carlosmarte / JavaScript_Remove_Array_Values.js
Created June 16, 2013 05:38
JavaScript extend array function, remove matching values from array
//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);
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
@carlosmarte
carlosmarte / JQuery Coffee Script On Scroll.js
Created June 25, 2013 05:20
JQuery Coffee.Script On Scroll
$(window).on 'scroll':->
console.log($(window).scrollTop())
@carlosmarte
carlosmarte / sammy app.js
Created June 25, 2013 05:23
Sammy.js Application
var app = $.sammy(function() {
// url: /#hello
this.get('#/hello', function() {
alert('hello world');
});
});
$(function() {
app.run();
$('div').eq(0).load('/page/about.html .content');
//*from google code example
escapeHtml = function(text) {
if (text == null) {
return '';
}
return text.replace(/&/g, '&').
replace(/</g, '<').
replace(/>/g, '>').
replace(/"/g, '"');
}
@carlosmarte
carlosmarte / Mac OS symlink
Created July 9, 2013 01:36
Mac OS create/remove symlink
@carlosmarte
carlosmarte / prevent terminal window from closing.sh
Last active December 19, 2015 16:49
How to prevent terminal window from closing
#Add read command to the end of your script.
echo "$( cd "$( dirname "$0" )" && pwd )"
read
!!! 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')
(function bars_stacked(container, horizontal) {
var
d1 = [],
d2 = [],
d3 = [],
graph, i;
for (i = 0; i < 4; i++) {
if (horizontal) {