Skip to content

Instantly share code, notes, and snippets.

View cronopio's full-sized avatar

Daniel Aristizabal cronopio

  • Pereira
View GitHub Profile
@cronopio
cronopio / client.js
Created October 28, 2011 16:51 — forked from tbranyen/client.js
Synchronize yo HTML5 slides
(function(window, document) {
// The end user should be allowed to disable synchronization. This button
// is optional on the page
var syncAllow = true;
var syncButton = document.querySelector('.sync-button');
// If the sync button exists bind a click event and toggle the syncAllow
// boolean. Set the value of the button.
if(syncButton) {
@cronopio
cronopio / gist:1307973
Created October 23, 2011 22:27
Testing vows-bdd
/**
* Pruebas para la creacion de un usuario en el sitio
*/
var Feature = require('vows-bdd').Feature,
http = require('http'),
assert = require('assert');
Feature('Creando un usuario', module)
@cronopio
cronopio / test.js
Created September 20, 2011 18:19
Playing with currency converter
var request = require('request');
var csv = require('ya-csv');
var qs = require('querystring');
request('http://finance.yahoo.com/d/quotes.csv?e=.csv&f=sl1d1t1&s=USDCOP=X', function(err, res, body){
if (err) throw new Error(err);
if (!err && res.statusCode == 200){
console.log('Respuesta correcta');
var usd = body.split(',');
console.log('Un dolar vale %d pesos colombianos', usd[1]);
@cronopio
cronopio / jslon.js
Created September 20, 2011 03:52
Testing google
/* Extremely loose JSON interpreter.
* Copyright 2011 Wa (logicplace.com)
* MIT Licensed
*/
JSLON = (function(){
var tokenize = /[\[{\]},:]|\s+|\/\*[\s\S]*\*\/|\/\/.*|"(\\.|\\(\r?\n|\n?\r)|[^"])*"|'(\\.|\\(\r?\n|\n?\r)|[^'])*'|\/(\\.|[^\/])+\/[igm]*|[$_a-zA-Z][$_a-zA-Z0-9]*|[+\-]?0x[0-9a-fA-F]+|[+\-]?[0-9]+e[+\-]?[0-9]*|[+\-]?[0-9]*\.[0-9]*|[+\-]?[0-9]+|Infinity|NaN|true|false|null|undefined/g
function usO(a,v){return String.fromCharCode(parseInt(v,8));}
function usX(a,v){return String.fromCharCode(parseInt(v,16));}
@cronopio
cronopio / index.html
Created September 14, 2011 00:10
Playing with WebSocket of Chrome
<html>
<head>
<title>MtGox Info Test</title>
<script type="text/javascript" src="main.js"></script>
<style type="text/css">
#main {
border:1px green solid;
margin: 0 auto;
width: 60%;
min-height: 200px;
@cronopio
cronopio / .gitignore
Created September 13, 2011 22:32
Playing with hook.io
gmon.out
node_modules/
@cronopio
cronopio / fx.js
Created June 12, 2011 04:18
Prueba de la libreria para animaciones
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('q $1y(g){7(g.18&&g.18==1)8 h=g;t 7(1z(g).19(/^#([^$]+)$/i)){8 h=1A.1B(K.$1+\'\');7(!h)9 Q}t 9 Q;7(W(h.6)!=\'X\'&&h.6){h.6.R();9 h};h.1C=0.1;h.6={};h.6.4=[];h.6.C=0;7(W(h.L)!=\'X\')1a{1b h.L}1c(1d){h.L=Q}8 k={\'1e|1f|1D|1E|1g|1h|1F|1G|1H|1i|1j\':\'1I\',\'1J\':\'1K\',\'E\':\'\'};8 l=!!1L.1M.19(/1N/1O);8 m={1k:S,H:5,D:\'\'};8 n={E:q(a,b){a=u(a);7(z(a)){7(l){8 c=(T K(\'1l\\\\s*\\\\(E\\\\s*=\\\\s*(\\\\d+)\\\\)\')).Y(h.v.1m+\'\');7(c)9 u(c[1]);t 9 1}t{9 Z.1P((h.v.E?1Q(h.v.E):1)*S)}}t{a=Z.1R(S,Z.1S(0,a));7(l){h.v.1T=1;h.v.1m=\'1l(E=\'+a+\');\'}t{h.v.E=a/S}}},\'1i\':q(a,b){a=u(a);8 x=0,y=0;8 c=(T K(\'^(-?\\\\d+)[^\\\\d\\\\-]+(-?\\\\d+)\')).Y(h.v.U+\'\');7(c){x=u(c[1]);y=u(c[2])}7(z(a))9 x;t{h.v.U=
@cronopio
cronopio / README.md
Created June 10, 2011 01:22 — forked from ucnv/README.md
@cronopio
cronopio / Readme.md
Created April 5, 2011 22:32
Script de migracion mas cercanos a quedar en tools para la migracion

##Orden de Ejecucion de scripts

Despues de tener volcada la base de datos de MySQL en archivos CSV uno por cada tabla, con los parametros adecuados y dentro de un directorio que debera ser por el momento probando-csv (en importar.sh:3 puede cambiarlo). Se corren los siguientes scripts.

  • importar.sh Usa mongoimport para restaurar los CSV en una database de mongoDB. La variable d indica el nombre del directorio.
  • completo.js Transforma los datos al nuevo modelo y los sanea.
  • quitarNull.js Elimina todos los NULLs de los valores de referencia
  • agregarCeros.js Agrega los ceros a la izquierda que tanto les gusta en el IRA
  • correccionesFinales.js Hacer la nueva version igualita a la vieja. :-(
@cronopio
cronopio / migracionPruebas.js
Created April 4, 2011 13:59
Script de migracion de pruebas segun modelo antiguo del SIPDS
db.pruebas.find().forEach(function(prueba){
print(' ');
print(' ');
print('-------- Inicio Procesamiento Prueba '+prueba.cod_ira);
print('NOMBRE: '+prueba.descrip_pru);
//print(tojson(prueba));
db.pru_param.find({cod_pru:prueba.cod_ira}).forEach(function(param){
if (param) {
// param es cada uno de los parametros descritos en esta tabla que pertenecen a la prueba
print('---- PARAMETRO ENCONTRADO');