Skip to content

Instantly share code, notes, and snippets.

View emaraschio's full-sized avatar
🏠
☕ 🤓

Ezequiel Maraschio emaraschio

🏠
☕ 🤓
View GitHub Profile
@emaraschio
emaraschio / gist:de459f573aef1617a5ce
Created November 28, 2014 22:37
Python Script: Transform JSON in CSV
#!/usr/bin/env python
import json
import csv
f = open('FILE.json')
data = json.load(f)
f.close()
f=csv.writer(open('FILE.csv','wb+'))
@emaraschio
emaraschio / Ruby Test Info
Created October 16, 2014 22:19
A few links about Testing with Ruby
Libraries:
http://cukes.info/
http://jnicklas.github.io/capybara/
https://github.com/teampoltergeist/poltergeist
http://phantomjs.org/
How to:
http://www.railsonmaui.com/tips/rails/capybara-phantomjs-poltergeist-rspec-rails-tips.html
https://github.com/teampoltergeist/poltergeist#installing-phantomjs
@emaraschio
emaraschio / PG::UndefinedTable Error on rspec tests
Last active August 29, 2015 14:07
For Example: PGError: ERROR: relation "users" does not exist
You need to execute the prepare and migrate command, to get all the schema up to date and with a good shape:
RAILS_ENV=test rake test:prepare
RAILS_ENV=test rake db:migrate
@emaraschio
emaraschio / How to install phantomjs in a vagrant precise32 machine
Last active August 29, 2015 14:06
How to install phantomjs in a vagrant precise32 machine
sudo apt-get install phantomjs
cd /usr/bin
sudo wget https://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-i686.tar.bz2
sudo tar xjf phantomjs-1.9.2-linux-i686.tar.bz2
sudo ln -s phantomjs-1.9.2-linux-i686/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s phantomjs-1.9.2-linux-i686/bin/phantomjs /usr/local/bin/phantomjs
sudo rm phantomjs
sudo ln -s phantomjs-1.9.2-linux-i686/bin/phantomjs /usr/bin/phantomjs
Gem
https://github.com/mileszs/wicked_pdf
Downloads
https://code.google.com/p/wkhtmltopdf/downloads/list?can=1&q=
Guides / Common issues
http://snikt.net/blog/2012/04/26/wicked-pdf/
https://gist.github.com/wrburgess/3778949
https://github.com/mileszs/wicked_pdf/wiki/Background-PDF-creation-via-delayed_job-gem