Skip to content

Instantly share code, notes, and snippets.

View acompa's full-sized avatar

Alejandro Companioni acompa

View GitHub Profile
package ccvalidation
import (
"fmt"
"strings"
)
type Card interface {
Validate(string ccNumber) bool
}
@acompa
acompa / keybase.md
Created January 5, 2015 19:09
keybase

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@acompa
acompa / rpy2_setup.sh
Created September 11, 2012 18:50
Installing rpy2
#!/bin/bash
# $1 == version of R to install
#####
# Install R
#####
wget http://cran.r-project.org/src/base/R-2/R-$1.tar.gz
tar zxvf R-$1.tar.gz
cd R-$1/
private ReplacementAlgorithm selectReplacementAlgorithm(String choice) {
if (choice.matches("N")) {
return new NRUAlgorithm();
} else if (choice.matches("l")) {
return new LRUAlgorithm();
} else if (choice.matches("r")) {
return new RandomAlgorithm();
} else if (choice.matches("f")) {
return new FIFOAlgorithm();
@acompa
acompa / transmit.py
Created July 24, 2012 20:28
Graphite tester
#!/usr/bin/python
""" Script for submitting data to Graphite. """
import socket
import time
import sys
import random
import string
@acompa
acompa / scrapegist.py
Created February 6, 2011 04:08
General idea behind opening and DLing BBs.
import urllib2, re
targetURL = "http://www.minneapolisfed.org/bb/reports/1990/90-01-su.cfm"
site = urllib2.urlopen(targetURL)
out = "/Users/alexc/Dropbox/Develop/BB/data/1990-01.html"
with open(out, 'w') as BBFile:
for line in site.readlines():
p = re.compile(r'<.*?>')
BBFile.write(p.sub('', line))
OSZAR »