Skip to content

Instantly share code, notes, and snippets.

View dviramontes's full-sized avatar
〰️
failing forward

David Viramontes dviramontes

〰️
failing forward
View GitHub Profile
@dviramontes
dviramontes / D3 setup
Created April 1, 2013 05:38
Tributary inlet
var svg = d3.select("svg");
svg.se
@dviramontes
dviramontes / jsdom.js
Created April 1, 2013 16:11
Screen Scraping with jsdom and node.js technique: http://blog.nodejitsu.com/jsdom-jquery-in-5-lines-on-nodejs
// The code creates a new jsdom window
// and adds jQuery to the document via a script element.
// Although it is just an illustrative
// example it is easy to modify it to work with
// real pages retrieved from the Internet.
var jsdom = require('jsdom');
jsdom.env({
html: "<html><body></body></html>",
# emulates "nrmwyoldrmtob".scan(/.{1,5}/)
# encodes 5 char words and then some
class A
@replace = (str)->
str.match(/[a-z|0-9]{5}|[\w]+/ig).join(" ")
test= A.replace("nrmwyoldrmtob")
/* apply a natural box layout model to all elements */
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; }
@paulirish
/*
recommendation for
IE8 and up
*/
d = Drums("xooxox",1/6);
@dviramontes
dviramontes / new_gist_file
Created June 23, 2013 23:14
Detect scroll top value of parent window
window.parent.$("body").animate({scrollTop:0}, 'slow');
@dviramontes
dviramontes / gist:5877343
Created June 27, 2013 15:19
git diff on server/
diff --git a/server/package.json b/server/package.json
index e8da09d..37ff4ef 100644
--- a/server/package.json
+++ b/server/package.json
@@ -5,7 +5,7 @@
"main": "index.js",
"scripts": {
"test": "grunt",
- "start": "node app/app.js"
+ "start": "node app.js"
@dviramontes
dviramontes / bashrc.bash
Created July 8, 2013 14:50
.bashrc file
# first ln -s ~/.bashrc ~/.bash_profile
# then
#Git tab completion
# source ~/git-completion.bash
# Show branch in status line
# PS1='[\W$(__git_ps1 " (%s)")]\$ '
# export PROMPT_COMMAND='echo -ne "\033]0;${PWD/#$HOME/~}\007"'
# Git branch in prompt.
parse_git_branch() {
@dviramontes
dviramontes / checklocal_storage.js
Created July 16, 2013 16:52
checklocal_storage support
// modernizr check
// for localStorage support
// if (Modernizr.localstorage){
// log("localStorage is available");
// }else{
// log("No native support for localStorage, load dojox.storage solution ...");
// }
@dviramontes
dviramontes / gist:6255051
Created August 17, 2013 03:07
Trumba code for christian :)
part of main.min.js
// adds Trumba spud to Homepage events <div>
$Trumba.addSpud({
webName: "msudenver-events-calendars",
spudType : "upcoming" ,
teaserBase : "http://www.trumba.com/calendars/msudenver-events-calendars",
spudId : "homepage_events"
})