Skip to content

Instantly share code, notes, and snippets.


Dan Racanelli elrasguno

View GitHub Profile
elrasguno /
Created Oct 17, 2016 — forked from mmaelzer/
Bash script to fetch latest polls-only forecast from Defaults to US but allows an optional state argument.
# Fetches data from,
# parses the results using python, and prints the polls-only forecast results in the format:
# The script takes an optional argument that specifies an individual two letter abbreviation (case insensitive)
# of a U.S. state. By default, the state is US which returns the national results.
# Examples:
elrasguno / aggregate_json_parser.js
Created Dec 1, 2014
Aggregate multiple JSON strings into one to save on JSON.parse CPU consumption.
View aggregate_json_parser.js
* Aggregate multiple JSON strings into one to save on CPU.
* @param {Array} jsonStringsArray An array of valid JSON strings to be parsed together.
* @returns {Array} An array of JavaScript Objects, or an empty array if any members of the input array are invalid JSON.
function aggregateParseJSON(jsonStringsArray)
var tmpArray = '[' + jsonStringsArray.join(',') + ']',
parsed = [];
elrasguno /
Last active Aug 29, 2015
How Unit Testing Saves Lives, or Your Sanity

(See original post, and some photography here)

For the longest time, I didn't really understand what it meant to unit test code. I remember thinking something along the lines of "wait, so I write a function that adds one to a number. then I write a test to prove that it added one to a number?" It just seemed to me, as I'm sure it does to many people, like extra work, and unit testing wasn't worth the overhead involved it testing all of my code. I mean, I tested it all when I was developing it, right?

Those were the good old days of back end development, when all you needed to do to test your app was hit your web interface, validate input for malicious data, and display error messages to users when they missed a spot filling in a form. Maybe you used an IDE for remote breakpoint debugging, but old school error logging usually did the trick just fine. Load page, fill form, validate error conditions, rinse, repeat.

In a mobile develop

elrasguno / vimrc
Created Dec 22, 2011
My vimrc file
View vimrc
" An example for a vimrc file.
" Maintainer: Bram Moolenaar <>
" Last change: 1999 Jul 25
" To use it, copy it to
" for Unix and OS/2: ~/.vimrc
" for Amiga: s:.vimrc
" for MS-DOS and Win32: $VIM\_vimrc
set noswapfile
elrasguno / jquery.animateDiv.js
Created Apr 13, 2011
Convert a container that normally holds a number into an "odometer" style collection of animated divs.
View jquery.animateDiv.js
(function($) {
$.extend($.fn, {
animateDiv : function(rValue, rOptions, rSpriteOrImg) {
var selff = this,
debug = false,
vFrames = rOptions['pFrames'] || 10,
vFrameSize = rOptions['pFrameSize'],
vOrientation = (rOptions['pOrientation'] > -1 ? rOptions['pOrientation'] : 1),
vClassName = rOptions['pClassName'] || 'numbers_test',
vSpriteOrImg = rSpriteOrImg || 'sprite';
elrasguno / Ringz.js
Created Apr 12, 2011
Possible approach to platform specific handling for ringz app.
View Ringz.js
console && console.log('this is ringz!');
var RingzApp = function(rPlatform) {
var vPlatform = rPlatform || 'web',
* Platform specific Clicker/Event config
elrasguno / index.html
Created Apr 5, 2011
View index.html
<!DOCTYPE html>
<script type="text/javascript" src="./interview_hello.js"></script>