Skip to content

Instantly share code, notes, and snippets.

View alexserver's full-sized avatar
🤓
Learning

Alejandro Gomez alexserver

🤓
Learning
View GitHub Profile
@alexserver
alexserver / circularref
Created January 27, 2015 22:12
Circular Reference in Javascript, and how to avoid it.
//https://www.npmjs.com/package/json-stringify-safe
var stringify = require("json-stringify-safe");
var a = {
type: "Son",
name: "John"
};
var b = {
type: "father",
@alexserver
alexserver / mongo.conf
Created April 13, 2015 13:47
mongo configuration for mac osx installed via homebrew
# Store data in /usr/local/var/mongodb instead of the default /data/db
storage:
dbPath: "/usr/local/var/mongodb"
journal:
enabled: false
# Append logs to /usr/local/var/log/mongodb/mongo.log
systemLog:
destination: file
@alexserver
alexserver / verPeliculas
Created May 23, 2015 22:14
Algoritmo de la gente normal que quiere ver peliculas en internet
//algoritmo de la gente normal que busca películas en internet
if (pelicula.release_date>(now.substract("2 months") ) ) {
download.from("thepiratebay")
}
else {
if (pelicula.is.in("netflix")) {
watch.it.in("netflix")
}
else {
download.from("thepiratebay")
@alexserver
alexserver / generators
Created June 2, 2015 23:09
Node Generators
"use strict";
//natural numbers.
function* naturalNumbers(){
var n = 1;
while (true){
yield n++;
}
}

authentication

var sb = require('sb');

auth

sb.connect('company', 'token').then(function(wrapper){
  
});
@alexserver
alexserver / rails-how-to.md
Created October 26, 2015 18:46
A quick how-to for Ruby On Rails

Rails How-to

Motivation

I'm learning rails, again, from scratch. I come from php and node environments.

Environment specs

I'm running a Vagrant machine with Ubuntu 14.04 64bits. In order to have the env ready for installing rails. We need to install some linux libraries.

@alexserver
alexserver / Vagrantfile
Created October 27, 2015 15:47
A Vagrantfile for most common rails setup
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure(2) do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@alexserver
alexserver / backbone-docs.md
Created November 5, 2015 16:53
Demo code to test Backbone documentation (version 0.9.9)

Events

On

var object = {};
_.extend(object, Backbone.Events);

var en = function(name){
    console.log('hello '+name);
}
@alexserver
alexserver / couchdb_include
Created December 17, 2012 18:03
include couchdb
<?php
//include classes...
include('CouchDbGateway.php');
include('CouchDbGateway.php');
?>
@alexserver
alexserver / conversacion_mitica_reforma_laboral
Created September 5, 2013 20:24
Texto mítico recolectado en facebook, donde cada quien dice(inventa) lo que quiere.
Con respecto al conflicto magisterial. No me sentía lo suficientemente informado como para ejercer una opinión. Por eso le pregunté directamente a un amigo mío que es maestro, para conocer un poco la perspectiva de aquellos que han hecho controversia en nuestra bella capital.
Les copio la conversación que tuve con él TAL CUAL sin edición, disculparán las groserías y la forma de hablar. Peros somos cuates, la pregunta que le hice es super casual y la conversación es meramente informal. A él me refiero como "Pare". Así empezó:
- Pare, que pedo con lo de los maestros? aquí en el DF hay varias banderas, cuentame tú que onda. Como está eso de que se niegan a la evaluación?
- Déjate del examen y esas mamadas a las que (según dicen) nos estamos oponiendo. Es una cortina de humo. En mi sección, somos 10800 maestros y NO HAY UNO QUE SE OPONGA A LA EVALUACION.
Cabrón, yo soy Lic. en Pedagogía, me eché 10 años en clases de piano, más la Lic. en Educación Musical.
Tú crees que le tengo al menos yo, miedo a la evalua