Skip to content

Instantly share code, notes, and snippets.

View aelesbao's full-sized avatar
👾
Flying

Augusto Elesbão aelesbao

👾
Flying
View GitHub Profile
@aelesbao
aelesbao / gem-list-native.rb
Created May 27, 2014 19:38
List gems with native extensions
require 'rubygems'
specs_with_extensions = Gem::Specification.each.select { |spec| spec.extensions.any? }
specs_with_extensions.each do |spec|
puts "#{spec.name} (extensions: #{spec.extensions.inspect})"
end
@aelesbao
aelesbao / partitioning.sql
Last active January 4, 2017 17:04
Postgres Partitioning example
DROP TABLE IF EXISTS measurement CASCADE;
-- our master table
CREATE TABLE measurement (
id bigserial PRIMARY KEY NOT NULL,
logdate date NOT NULL
);
-- create the partitions
CREATE TABLE measurement_2016_12 (
@aelesbao
aelesbao / install-octave.sh
Last active November 7, 2016 23:19
Octave installation on Mac OS X
#!/bin/sh
brew tap homebrew/science
brew cask install aquaterm xquartz
brew install gnuplot --with-aquaterm --with-x11
brew install octave --with-sndfile --without-qt5
# Now you can use either Aquaterm or X11 as your graphics engine.
# Add the following to ~/.octaverc and choose one:
#
# graphics_toolkit('gnuplot');

Keybase proof

I hereby claim:

  • I am aelesbao on github.
  • I am aelesbao (https://keybase.io/aelesbao) on keybase.
  • I have a public key ASBtZdMx-YRdcXLMxZ7lN7vAXpkVMJYznmhjQcauonLULQo

To claim this, I am signing this object:

# sets the correct term
set -g default-terminal "screen-256color"
# allow xterm titles in terminal window and terminal scrolling with scrollbar
set -g terminal-overrides "screen*:XT:smcup@:rmcup@"
# automatically set window title
setw -g automatic-rename on
setw -g allow-rename off
@aelesbao
aelesbao / post-checkout.sh
Last active December 12, 2015 04:49
git post-checkout hook that executes a "bundle install" if Gemfile has changes (using RVM if available)
#!/bin/bash --login
orig_commit=$1
dest_commit=$2
root="$(git rev-parse --show-toplevel 2> /dev/null)"
is_not_rebasing() {
test -d ${root}/.git/rebase-merge
}