Skip to content

Instantly share code, notes, and snippets.

@jrmoran
jrmoran / assets.yml
Created December 7, 2011 07:10
minify js and css files
# These files will be minified ...
javascripts:
- build/js/ga.js
- build/js/jquery-1.7.1.js
- build/js/portfolio.js
styles:
- build/style/screen_v3.css
# And combined into single files
@jrmoran
jrmoran / annotations.sass
Created November 26, 2011 04:56
Annotation Maker
@import compass/css3, compass/utilities
#annotation-tooltip
border: 2px solid #999999
display: none
font-size: 11px
left: 160px
padding: 10px
position: absolute
text-align: center
@jrmoran
jrmoran / Custom.css
Created November 24, 2011 06:01 — forked from star-szr/Custom.css
IR_Black Theme (with sidebar and view-source colors) for Chrome Developer Tools
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@jrmoran
jrmoran / privileged_methods.coffee
Created November 21, 2011 01:34
Privileged methods CoffeeScript
class Person
constructor: (name)->
@name = name
# private method
greet_p = (person = {}) ->
msg = if person.hasOwnProperty 'name'
"Hi #{person.name}"
else
@jrmoran
jrmoran / radios.js
Created November 11, 2011 22:06
adding radios elements
// This takes ~35ms
console.time('Virguilla radios');
for(var x=0; x<500; x++){
var radios=document.createElement("input");
radios.type = "radio";
radios.id = "nombreRadio"; // NOOOOOOOOOOO!
radios.name = "nombreRadio";
radios.value = x;
document.getElementById("test-form").appendChild(radios); // NOOOO!
@jrmoran
jrmoran / roll.js
Created November 4, 2011 00:09
Roll
(function(){
var styleObj=document.createElement("style");
styleObj.setAttribute("type","text/css");
document.getElementsByTagName("head")[0].appendChild(styleObj);
var style = "@-webkit-keyframes roll { from { -webkit-transform: rotate(0deg) } to { -webkit-transform: rotate(360deg) } } @-moz-keyframes roll { from { -moz-transform: rotate(0deg) } to { -moz-transform: rotate(360deg) } } @keyframes roll { from { transform: rotate(0deg) } to { transform: rotate(360deg) } } body { -moz-animation-name: roll; -moz-animation-duration: 4s; -moz-animation-iteration-count: 1; -webkit-animation-name: roll; -webkit-animation-duration: 4s; -webkit-animation-iteration-count: 1; }";
styleObj.appendChild(document.createTextNode(style));
}());
@jrmoran
jrmoran / mongo_wrapper.coffee
Created October 28, 2011 22:38
little mongo wrapper for node.js
mongodb = require 'mongodb'
db = {}
options = {}
check_for_errors = (err)->
if err then console.log "#{err}"
# configurate and connect to the database, `options` must be an object
# literal
#
@jrmoran
jrmoran / isDui.js
Created October 28, 2011 00:48
Verificacion DUI
/*
DUI = 00016297-5
Posiciones -> 9 8 7 6 5 4 3 2
DUI -> 0 0 0 1 6 2 9 7
DV = 5
sum: (9*0) + (8*0) + (7*0) + (6*1) + (5*6) + (4*2) + (3*9) + (2*7) = 85
residuo: (85 % 10) = 5
resta: 10 - residuo = 5
@jrmoran
jrmoran / crimea.csv
Created October 5, 2011 07:53 — forked from mbostock/.block
Stacked Bar Chart
date wounds other disease
5/1854 0 95 105
6/1854 0 40 95
7/1854 0 140 520
8/1854 20 150 800
9/1854 220 230 740
10/1854 305 310 600
11/1854 480 290 820
12/1854 295 310 1100
1/1855 230 460 1440
@jrmoran
jrmoran / index.html
Created October 5, 2011 07:52 — forked from mbostock/.block
Axis Component
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js?2.0.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.csv.js?2.0.0"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.time.js?2.0.0"></script>
<style type="text/css">
body {
font: 10px sans-serif;