Skip to content

Instantly share code, notes, and snippets.

View plribeiro3000's full-sized avatar
😎

Paulo Ribeiro plribeiro3000

😎
View GitHub Profile
@mlocher
mlocher / install_phantomjs.sh
Last active September 7, 2015 11:56
Install PhantomJS
#!/bin/bash
#
# NOTICE
# A new and updated version of this script is provided at
# https://github.com/codeship/scripts/blob/master/packages/phantomjs.sh
# Please switch to that version instead!
PHANTOMJS_VERSION="1.9.8"
# clean old version and setup directories
rm -rf ~/.phantomjs
@iHiD
iHiD / config.rb
Last active June 10, 2017 15:05
Baruco 2014 Live Coding Talk on Propono.
require 'propono'
Propono.config do |config|
config.access_key = "AKIAIPE2MSOM5ZFGQBCQ"
config.secret_key = "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"
config.queue_region = "eu-west-1"
end
require 'twitter'
@twitter = Twitter::REST::Client.new do |config|
config.consumer_key = "OG9Zkag09onRe7b5ZLecO7HGb"
@sauloperez
sauloperez / signal_catching.rb
Last active December 14, 2024 13:43
How to catch SIGINT and SIGTERM signals in Ruby
# Signal catching
def shut_down
puts "\nShutting down gracefully..."
sleep 1
end
puts "I have PID #{Process.pid}"
# Trap ^C
Signal.trap("INT") {
@robertsosinski
robertsosinski / http.rb
Created September 1, 2011 22:20
Varnish utility module, requires extended Net::HTTP
require 'net/http'
module Net
class HTTP
class Purge < HTTPRequest
METHOD = "PURGE"
REQUEST_HAS_BODY = false
RESPONSE_HAS_BODY = true
end
@lucashungaro
lucashungaro / links.textile
Created August 14, 2010 16:36
Links de referência utilizados em minha palestra