This file contains 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
# Jaime Moran | |
require 'net/http' | |
def download_captcha file_name | |
uri = URI.parse('http://www.corporativo.telefonica.com.sv/EnviarSMSSV/faces/' + | |
'EnviarSMS.jsp?vrClientId=form1:imageEx1') | |
headers = { 'user-agent' => 'Mozilla/4.0 (Compatible; MSIE 4.0)' } | |
http = Net::HTTP.start(uri.host, uri.port) | |
response = http.request_get(uri.path, headers) | |
This file contains 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
# Cakefile to document, compile, join and minify CoffeeScript files for | |
# client side apps. Just edit the config object literal. | |
# | |
# -jrmoran | |
fs = require 'fs' | |
{exec, spawn} = require 'child_process' | |
# order of files in `inFiles` is important | |
config = |
This file contains 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
timeIt = (f)-> | |
start = Date.now() | |
f() | |
console.log 'time: ', Date.now() - start, 'ms' | |
adder = -> | |
total = 0 | |
((n = 0)-> total += n) | |
timeIt -> |
This file contains 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 myLoader = function(filename, fun) { | |
var head = document.getElementsByTagName('head')[0], | |
script = document.createElement('script'); | |
script.type = 'text/javascript'; | |
script.src = filename; | |
if(typeof fun === 'function'){ script.onload = fun; } | |
head.appendChild(script); | |
}; |
This file contains 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
$ -> | |
# Inspired in | |
# [this](http://adamjspooner.github.com/coffeescript-meet-backbonejs/) | |
# | |
# Live sample [here](http://jrmoran.com/playground/backbone-coffeescript/) | |
# override backbone sync, so when we remove/save items no server calls | |
# are made | |
Backbone.sync = (method, model, success, error) -> success() |
This file contains 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
companies = [{"id":1,"ticker":"AAPL","name":"Apple Inc"}, | |
{"id":2,"ticker":"ABC","name":"Amerisourcebergen Corp"}, | |
{"id":3,"ticker":"ABT","name":"Abbott Labs"}, | |
{"id":4,"ticker":"ACE","name":"Ace Ltd"}, | |
{"id":5,"ticker":"ADBE","name":"Adobe Sys Inc"}] | |
_.templateSettings = interpolate :/\{\{(.+?)\}\}/g | |
$ -> |
This file contains 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
require 'posterous' | |
require 'time' | |
# Add your credentials Here | |
Posterous.config = { | |
'username' => '<email-address>', | |
'password' => '<password>', | |
'api_token' => '<api-token>' | |
} |
This file contains 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
(defn fib [n] | |
(Math/round (/ (- (Math/pow 1.618034 n) | |
(Math/pow (- 0.618034) n)) | |
(Math/sqrt 5)))) | |
(map fib (range 51)) | |
;; (0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946 17711 28657 46368 75025 121393 196418 317811 514229 832040 1346269 2178309 3524579 5702888 9227467 14930356 24157823 39088179 63246003 102334183 165580188 267914374 433494567 701408948 1134903525 1836312490 2971216044 4807528580 7778744699 12586273401) |
This file contains 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
m0101 Ahuachapán | |
m0102 Apaneca | |
m0103 Atiquizaya | |
m0104 Concepción de Ataco | |
m0105 El Refugio | |
m0106 Guaymango | |
m0107 Jujutla | |
m0108 San Francisco Menéndez | |
m0109 San Lorenzo | |
m0110 San Pedro Puxtla |
This file contains 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 drawVisualization() { | |
var col1 = ["AP","AP-PAN","ARENA","CD","CD-PNL","CDU","CDU-FMLN","CDU-PSD","FC","FDR","FDR-CD","FDR-PDC","FDR-PDC-CD","FMLN","FMLN-CD","FMLN-PDC","FMLN-PSD","PAN","PCN","PDC","PDC-FMLN","PDC-FMLN-CD","PDC-PMR-PSD","PDC-PSD","PMR","PMR-PDC","PMR-PDC-PSD-CDU","PMR-PSD","PMR-PSD-CDU","PNL","PPR","PSD"]; | |
var col2 = ["AP","AP-PAN","ARENA","CD","CD-PNL","CDU","CDU-FMLN","CDU-PSD","FC","FDR","FDR-CD","FDR-PDC","FDR-PDC-CD","FMLN","FMLN-CD","FMLN-PDC","FMLN-PSD","PAN","PCN","PDC","PDC-FMLN","PDC-FMLN-CD","PDC-PMR-PSD","PDC-PSD","PMR","PMR-PDC","PMR-PDC-PSD-CDU","PMR-PSD","PMR-PSD-CDU","PNL","PPR","PSD"]; | |
var table1 = [["2003",11990,374,491452,0,0,37629,84995,123,10208,0,0,0,0,471042,0,19739,259,11416,210056,104494,0,0,13105,592,26447,4101,2493,3104,374,0,20419,7773],["2006",0,0,791811,30778,24101,0,0,0,0,0,0,0,0,670711,106314,0,0,0,307330,173982,12192,0,0,0,0,0,0,0,0,2637,0,0],["2009",0,0,867273,25204,0,0,0,0,0,20962,6450,5020,1689,886161,237119,0,0,0,235989,185844,8755,7811,0, |