Skip to content

Instantly share code, notes, and snippets.

View amaia's full-sized avatar

Amaia Castro amaia

  • Madrid
View GitHub Profile
@amaia
amaia / facturagem_pdf_downloader.rb
Created August 9, 2012 16:28
Script to download all invoice pdfs from facturagem.com
#!/usr/bin/env ruby
require 'httparty'
login = ENV['LOGIN']
password = ENV['PASSWORD']
options = {:body => {:login => login, :password => password}}
r = HTTParty.post('https://facturagem.com/api/session.json', options)
api_key = r.parsed_response['user']['api_key']
@amaia
amaia / check_sphinx_ports
Created November 29, 2011 16:53
Check config files for occupied sphinx ports
ruby -e "require 'yaml'; Dir.glob('/home/*/app/current/config/sphinx.yml').each{|yml| puts YAML.load_file(yml)['production']['port']}" | sort
@amaia
amaia / gist:1115627
Created July 30, 2011 15:14
copy yml example files
ruby -e "Dir.glob('*.yml.example'){|x| system \"cp #{x} #{x.split('.')[0..-2].join('.')}\"}"
@amaia
amaia / conferencia_rails_2011_slides.md
Created July 18, 2011 11:12
Conferencia Rails 2011 Slides
@amaia
amaia / jazzfonica.rb
Created June 14, 2011 13:10 — forked from javier/jazzfonica.rb
jazzfonica
#!/usr/bin/env ruby
# jazzfonica.rb for Mac OS X
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal
#ported to ubuntu from https://gist.github.com/1024587
#it will ask for sudo privileges.
#if your wlan card is not "wlan0" change the "my_wifi_card" variable
@amaia
amaia / jazzfonica.rb
Created June 14, 2011 10:21 — forked from christos/jazzfonica.rb
jazzfonica
#!/usr/bin/env ruby
# jazzfonica.rb for Mac OS X
# Scans the visible networks for JAZZTEL_XXXX or WLAN_XXXX and calculates the password
# Ported from PHP example at http://kz.ath.cx/wlan/codigo.txt
# Download and execute with ruby (e.g. ruby jazzfonica.rb) from a Terminal
require 'digest/md5'
messages = []
unless !File.exists?('/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport')
@amaia
amaia / svn_cheatsheet.txt
Created March 16, 2011 10:29
svn cheatsheet
show last 5 commits in reverse cronological order
svn log --limit 5
svn log -l5
@amaia
amaia / gist:727307
Created December 3, 2010 18:15
vim cheatsheet
cerrar todos los buffers abiertos
:%bd(delete)
cerrar el resto de ventanas
:on
:bw
Like |:bdelete|, but really delete the buffer.
:bd
@amaia
amaia / reset.css
Created October 15, 2010 15:17
reset css
body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td {
margin: 0;
padding: 0;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
@amaia
amaia / gist:616885
Created October 8, 2010 14:29
git cheatsheet

Working with remotes

http://help.github.com/remotes/

If you cloned a repo git will create a remote named “origin” automatically.

list remotes git remote