Skip to content

Instantly share code, notes, and snippets.

View gcorreaq's full-sized avatar

Gonzalo Correa-Young gcorreaq

View GitHub Profile
@gcorreaq
gcorreaq / install_run_mongodb
Created December 31, 2011 20:34
Install and Run MongoDB in OS X with Homebrew
brew update
brew install mongodb
sudo mongod
@gcorreaq
gcorreaq / prueba_control_4.py
Created January 23, 2012 23:57
Código para corregir control 4 del ramo "Programación", 2011-2 USM
python prueba_control_4.py RUT.py
@gcorreaq
gcorreaq / README.md
Last active November 3, 2022 23:59
Función en Python para transformar números romanos a arabigos
@gcorreaq
gcorreaq / .bash_profile
Created February 1, 2012 21:02
Change the command prompt in Ubuntu to show only "user@host:current_directory $ "
export PS1="\u@\h:\W \$ "
@gcorreaq
gcorreaq / haml-watch.rb
Created February 23, 2012 19:11
Watch and compile all haml files on a directory, like sass --watch
#!/usr/bin/env ruby
# Script to watch a directory for any changes to a haml file
# and compile it.
#
# USAGE: ruby haml_watch.rb <directory_to_watch> [output_directory]
#
# Blake Smith / http://blakesmith.github.com/2010/09/05/haml-directory-watcher.html
#
# Fork by Gonzalo Correa (https://github.com/gcorreaq)
#
@gcorreaq
gcorreaq / htop-on-lion.md
Created April 18, 2012 17:12 — forked from blakeeb/htop-on-lion.md
Installing htop on OSX Lion
@gcorreaq
gcorreaq / data.txt
Created May 12, 2012 22:24
Datos para revisar el control 3 de programación.
4
2
55
55
4
45
38
78
67
4
@gcorreaq
gcorreaq / gist:3286444
Created August 7, 2012 15:33
Install Python, pip, virtualenv and virtualenvwrapper in OS X with Homebrew

First, edit your .bash_profile (or create it in your home directory), and add this lines

# For Homebrew
PATH="/usr/local/bin:/usr/local/sbin:$PATH"

# For Homebrew Python 2.7
PATH="/usr/local/share/python:$PATH"

Restart your terminal, so the new .bash_profile is loaded, and execute this commands

@gcorreaq
gcorreaq / gist:3909656
Created October 18, 2012 03:07
SPDY server with Node.js
/**
* Module dependencies.
*/
var spdy = require('spdy')
, express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path')
@gcorreaq
gcorreaq / extract_rand_lines.py
Created April 10, 2013 04:46
Script for taking random lines from a file (with repetition), and put them in separate files, one per process worker.
import multiprocessing
import random
import clint
def count_lines(path):
with open(path, 'r') as file_r:
line_number = 0