Skip to content

Instantly share code, notes, and snippets.

View andion's full-sized avatar
🐶

Lucas Andión Montáns andion

🐶
View GitHub Profile
# Testing gistr
# http://github.com/blog/137-gist-on-your-tumblr
This example shows how to setup an environment running Rails 3 beta under 1.9.1 with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell))
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.1
# Switch to 1.9.1
∴ rvm 1.9.1
rvm --trace package install readline
--trace package install readline
rvm 0.1.23 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
+ [[ -z '' ]]
+ [[ ! -z '' ]]
+ [[ ! -z '' ]]
+ [[ ! -z '' ]]
+ [[ 3 -gt 0 ]]
%w(won won won won won won LOST).inject(%w(lucas asis oscar adrian alejo marcos david)) {|acc,s| puts [acc.delete_at(rand(acc.length)),s].join(' ');sleep 3 if acc.length > 1; acc}
@andion
andion / loteria_navidad.rb
Created December 22, 2010 09:35
A little script to check spanish christmas lottery numbers on real time checking elpais.com API
#!/usr/bin/env ruby
url = 'http://api.elpais.com/ws/LoteriaNavidadPremiados?n='
urls = {}
if ARGV.any?
ARGV.each do |n|
urls[n] = "#{url}#{n.to_i}"
end
@andion
andion / loteria_navidad.rb
Created December 22, 2010 09:44
Similar lottery-check script to https://gist.github.com/751314 but only print something if you've won something
#!/usr/bin/env ruby
url = 'http://api.elpais.com/ws/LoteriaNavidadPremiados?n='
urls = {}
if ARGV.any?
ARGV.each do |n|
urls[n] = "#{url}#{n.to_i}"
end
@andion
andion / Cheat Compilation
Last active May 25, 2016 11:30 — forked from afair/tmux.cheat
Tmux Quick Reference & Cheat sheet - 2 column format for less scrolling!
========================================== ==========================================
TMUX COMMAND WINDOW (TAB)
========================================== ==========================================
List tmux ls List ^b w
New -s <session> Create ^b c
Attach att -t <session> Rename ^b , <name>
Rename rename-session -t <old> <new> Last ^b l (lower-L)
Kill kill-session -t <session> Close ^b &
@andion
andion / agnoster-andion.zsh-theme
Last active June 17, 2017 04:14
Oh-my-zsh agnoster theme modified to suit my needs
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://gist.github.com/1595572).
#
@andion
andion / .gitignore
Last active April 9, 2018 05:30
Play all ~/Music/**/*{.mp3} files using afplay
.DS_Store
// Function that gets the drawImage required parameters to
// resize an image by a scale
const getDrawImageParams = (image, scale) => {
const {naturalWidth: imageWidth, naturalHeight: imageHeight} = image;
return {
sx: 0,
sy: 0,
sWidth: imageWidth,