Ubuntu 12.10 setup (rbenv/RVM, Janus, PostgreSQL)
- Some utilities:
sudo apt-get install vim tmux git curl
- Copy/paste from the command line:
# array of arrays | |
a = [[10, 1000], [9, 923], [8, 1230], [7, 10]] # [data,frequency] | |
mean = a.reduce(0) { |m,r| m += r[0] * r[1] } / a.reduce(0) { |m,r| m += r[1] }.to_f |
/* | |
* Unobtrusive autocomplete for model associations. | |
* | |
* For instance, assume you have a model `Task' and a model `User'. The task has | |
* an attribute user_id which associates the user who is assigned to the task. | |
* This widget allows you to build a form for tasks where the association is | |
* represented by a hidden user_id field that gets populated through an | |
* autocomplete text field. | |
* | |
* To use it you just have to include the tag attributes for the autocomplete |
# From http://garmoncheg.blogspot.com/2012/06/pretty-git-log.html | |
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" |
sudo apt-get install vim tmux git curl
.leaflet-div-icon { | |
background: transparent; | |
border: none; | |
} | |
.leaflet-marker-icon .number{ | |
position: relative; | |
top: -37px; | |
font-size: 12px; | |
width: 25px; |