Skip to content

Instantly share code, notes, and snippets.

View gcaixeta's full-sized avatar

Callisto Caixeta gcaixeta

  • São Paulo, Brazil
View GitHub Profile
@gcaixeta
gcaixeta / 00.howto_install_phantomjs.md
Created January 9, 2019 15:38 — forked from leommoore/00.howto_install_phantomjs.md
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 2.1.1

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev

Keybase proof

I hereby claim:

  • I am gcaixeta on github.
  • I am gcaixeta (https://keybase.io/gcaixeta) on keybase.
  • I have a public key ASDa16YNW4ha90ZXK9P0725rDd6CpIDG69IfNtimKOtwgAo

To claim this, I am signing this object:

git diff --name-status branch..HEAD | grep A
@gcaixeta
gcaixeta / setup.sh
Last active July 13, 2016 21:53 — forked from lazypower/setup.sh
Setup headless chromium driver for selenium (vagrant flavor, but works with any ubuntu variant)
#!/bin/sh
set -e
if [ -e /.installed ]; then
echo 'Already installed.'
else
echo ''
echo 'INSTALLING'
echo '----------'
@gcaixeta
gcaixeta / gist:54014255e03d3996e443
Last active October 10, 2017 19:38
archive all messages at couchsurfing
https://www.couchsurfing.com/messages?per_page=6000
var data = { '_method' : 'patch',
'authenticity_token' : jQuery('meta[name="csrf-token"]').attr('content')
}
jQuery('.inbox-thread__item').each(
function(i,e){
var id = jQuery(e).attr('id')
@gcaixeta
gcaixeta / gist:3498224
Created August 28, 2012 13:57
how to get the original picture-url from the linkedin gem api
c = LinkedIn::Client.new
c.authorize_from_access authentication.token, authentication.secret
c.search(fields: [{:people => [:picture_url]}]).people.all.first.try(:picture_url)
#or better
c.profile(:fields => ['picture-urls::(original)']).picture_urls.all.first
@gcaixeta
gcaixeta / alize_extension.rb
Created August 2, 2012 12:03
define class methods to access denormalized fields at the _fields hash
module AlizeExtension
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def alize_with_methods(relation, *fields)
alize relation, *fields
fields.each do |field|
define_method "#{relation}_#{field}" do
@gcaixeta
gcaixeta / gist:1180484
Created August 30, 2011 08:45 — forked from viniciusteles/gist:556029
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
<%= form_tag selected_categories_path, :multipart => true do %>
<%= text_field_tag 'dog[]', "dog1" -%>
<%= text_field_tag 'dog[]', "dog2" -%>
<%= file_field_tag 'attachment' -%>
Parameters: {"dog"=>["dog1dog2"]}
logo_image = case movie.width
when 640..2000 #720
"logos/logo-187x127.png"
when 464..639
"logos/logo-120x81.png"
when 360..463
"logos/logo-100x68.png"
when 320..359
"logos/logo-83x56.png"
when 220..319