Skip to content

Instantly share code, notes, and snippets.

Alejandro Gomez alexserver

Block or report user

Report or block alexserver

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
alexserver /
Created Feb 17, 2017
Remove Outdated Vagrant Boxes
# Find all boxes which have updates
AVAILABLE_UPDATES=`vagrant box outdated --global | grep outdated | tr -d "*'" | cut -d ' ' -f 2`
for box in $AVAILABLE_UPDATES ; do
echo "Found an update for $box"
alexserver /
Created Nov 5, 2015
Demo code to test Backbone documentation (version 0.9.9)



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

var en = function(name){
    console.log('hello '+name);
alexserver /
Created Oct 28, 2015
REST basics, Theory, Principles, and examples.

RESTful API know-how


I place my learning process in this document with 2 motives:

  1. To have a quick guide whenever I lost the track of knowledge.
  2. To share the knowledge with anyone wants to learn RESTful APIs

1. Before, some theory

alexserver /
Created Oct 27, 2015
A shell script that sets a 4gb swap file. This is useful for vagrant machines.
# size of swapfile in megabytes
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
alexserver / Vagrantfile
Created Oct 27, 2015
A Vagrantfile for most common rails setup
View Vagrantfile
# -*- 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 /
Created Oct 26, 2015
A quick how-to for Ruby On Rails

Rails How-to


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.



var sb = require('sb');


sb.connect('company', 'token').then(function(wrapper){
View generators
"use strict";
//natural numbers.
function* naturalNumbers(){
var n = 1;
while (true){
yield n++;
alexserver / verPeliculas
Created May 23, 2015
Algoritmo de la gente normal que quiere ver peliculas en internet
View verPeliculas
//algoritmo de la gente normal que busca películas en internet
if (pelicula.release_date>(now.substract("2 months") ) ) {
else {
if ("netflix")) {"netflix")
else {
alexserver / mongo.conf
Created Apr 13, 2015
mongo configuration for mac osx installed via homebrew
View mongo.conf
# Store data in /usr/local/var/mongodb instead of the default /data/db
dbPath: "/usr/local/var/mongodb"
enabled: false
# Append logs to /usr/local/var/log/mongodb/mongo.log
destination: file
You can’t perform that action at this time.