Skip to content

Instantly share code, notes, and snippets.

View rbonvall's full-sized avatar

Roberto Bonvallet rbonvall

View GitHub Profile
@rbonvall
rbonvall / fstab
Created November 11, 2011 01:33
fstab de loquito
#
# /etc/fstab
# Created by anaconda on Fri Apr 22 00:06:17 2011
#
# Accessible filesystems, by reference, are maintained under '/dev/disk'
# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
#
/dev/mapper/vg_loquito-lv_root / ext4 defaults 1 1
UUID=8a7cf1e0-b7b1-4e7e-bc94-87b80b32e2af /boot ext4 defaults 1 2
/dev/mapper/vg_loquito-lv_home /home ext4 defaults 1 2
@rbonvall
rbonvall / programas.py
Created November 16, 2011 23:20
Listings with named ranges using pgf's \foreach doesn't work
# P1
s = {78, 15, 91, 15}
print len(s)
# FIN P1
# P2
d = {78: 15, 91: 15}
print len(d)
# FIN P2
@rbonvall
rbonvall / sum.cu
Created February 3, 2012 17:53
c ← a + b in CUDA
__global__ void sum(float *a, float *b, float *c) {
int i = threadIdx.x + blockDim.x * blockIdx.x;
c[i] = a[i] + b[i];
}
@rbonvall
rbonvall / pot.py
Created February 21, 2012 19:32
Conjunto potencia en Python
def es_par(x):
return x % 2 == 0
def conjunto_potencia(s):
n = len(s)
# crear lista con 2^n conjuntos vacios
subconjuntos = []
for i in range(2 ** n):
subconjuntos.append(set())
@rbonvall
rbonvall / example.rst
Created June 30, 2012 01:22
Three examples of RestructuredText tables. The last one is not handled correctly by pandoc.

Example 1:

Header row, column 1 Header 2 Header 3
body row 1, column 1 column 2 column 3
body row 2 Cells may span
@rbonvall
rbonvall / test.tex
Created September 24, 2012 22:30
XeLaTeX test
\documentclass{article}
\usepackage{mathpazo}
\usepackage{xunicode}
\usepackage{fontspec}
\usepackage{listings}
\usepackage{xcolor}
\usepackage{fancyvrb}
\usepackage{polyglossia}
\setromanfont{TeXGyrePagella}
@rbonvall
rbonvall / porbajar
Created December 30, 2012 17:38
van Gerwen v Lewis
http://www.youtube.com/watch?v=7YcPEKNDWng
http://www.youtube.com/watch?v=BKCz89o8cbs
http://www.youtube.com/watch?v=mmoZRzUVf_Y
http://www.youtube.com/watch?v=t1g9CiP2cc4
http://www.youtube.com/watch?v=fqWXVd5Vx-w
http://www.youtube.com/watch?v=17FZEJaApxE
@rbonvall
rbonvall / final.
Created January 2, 2013 01:55
Final 2013. Lewis v van Gerwen
#http://www.youtube.com/watch?v=1CjG0CitrbQ
http://www.youtube.com/watch?v=m9vUrgftdE4
http://www.youtube.com/watch?v=TIwIE0p0Wow
http://www.youtube.com/watch?v=GcKngtLYC9Y
http://www.youtube.com/watch?v=jUKmXmReyms
http://www.youtube.com/watch?v=5FdUh66As2c
http://www.youtube.com/watch?v=DfgHEGNf3NA
http://www.youtube.com/watch?v=X43eEqXBzI8
http://www.youtube.com/watch?v=CyRFG2dTal4
http://www.youtube.com/watch?v=A_0Gkxj1uh8
@rbonvall
rbonvall / self-ref.js
Created June 28, 2013 06:19
Incorrect example from the section on Prototype-based object-oriented programming, from @fogus's Functional JavaScript.
var a = {
name: 'a',
fun: function () { return this; }
};
var bFunc = function () { return this; };
var b = {
name: 'b',
fun: bFunc
};
@rbonvall
rbonvall / setup.sh
Created July 25, 2013 21:33
Setup for EC2 instances created for the Startup Engineering class
sudo apt-get install -y git
sudo apt-get install -y curl
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
# Load nvm and install latest production node
source $HOME/.nvm/nvm.sh
nvm install v0.10.12
nvm use v0.10.12
npm install -g jshint