Skip to content

Instantly share code, notes, and snippets.

View jpablobr's full-sized avatar

Pablo Barrantes jpablobr

View GitHub Profile
@jpablobr
jpablobr / subcommand.rb
Created October 17, 2011 15:31
A tiny wrapper over optparse that gives easy subcommand facility.
#!/usr/bin/env ruby -w
######################################
# A tiny wrapper over optparse that gives easy subcommand facility.
# It also neatly prints help for global and subcommands
# as well as summarizes subcommands in global help.
#
# Thanks to Robert Klemme for his idea on lazy loading the subcommand option parsers.
#
# @author Rahul Kumar, Jun 2010
# @date 2010-06-20 22:33
xcnm,,,vv fjflkasjdf;lasj op''njA X (}Nc afv .lvco /b[piçkfkfk
@jpablobr
jpablobr / keymap_guillotine.c
Created December 26, 2017 03:02
An Atreus right-handed layout designed mostly to reduce wrist and pinky RSI
#include "keymap_common.h"
/* An Atreus right-handed layout designed mostly to reduce wrist and pinky RSI
* by helping you to stay closer to home-row.
*
* This is achieved mostly by relying significantly on dual-role keys, but only
* on the less used or non-alphanumeric ones to avoid conflicts or activating
* incorrect key-codes when speed typing. The SHIFT dual-role keys are probably
* the most problematic ones (i.e., typing "za" might end up sending "A") but,
* again, "Z" isn't really a commonly used letter in English and in worst case
@jpablobr
jpablobr / gitflow-breakdown.md
Created September 29, 2017 04:58 — forked from JamesMGreene/gitflow-breakdown.md
A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
git commit --allow-empty -m "Initial commit"
git checkout -b develop master

Connect to the remote repository

#!/bin/bash
#
# Author: Josh Frye <joshfng>
# Licence: MIT
#
# Contributions from: Wayne E. Seguin <wayneeseguin@gmail.com>
#
# To run:
# sudo apt-get -y install curl && curl https://github.com/joshfng/railsready/raw/master/railsready.sh >> railsready.sh && chmod a+x railsready.sh && ./railsready.sh
# The script will ask if you want to build Ruby from source or install RVM
# See also:
# Fine-tuning tab completion in Bash,
# http://codesnippets.joyent.com/posts/show/1690
export PATH=/usr/bin:/bin:/usr/sbin:/sbin
export IFS=$' \t\n'
help fc
# for more info: https://gist.github.com/1120938
@jpablobr
jpablobr / gifs.rb
Last active December 10, 2015 17:08
This script will parse all @gifs tweets searching for gifs urls and download them.
#!/usr/bin/env ruby
# This script will parse all @gifs tweets searching for gifs urls and
# download them.
# Initial disclaimer!
# This mess is gonna get raw, like sushi. So haters to the left.
# Usage:
# $ git clone https://gist.github.com/4465778.git gifs
@jpablobr
jpablobr / tork_tcp.rb
Created February 14, 2012 23:57
Tork TCP notifications
require 'socket'
require 'tork/config'
require 'set'
failed_test_files = Set.new
socket = TCPSocket::new("localhost", 5000)
Config.test_event_hooks.push lambda {|message|
event, test_file, line_numbers, log_file = message
@jpablobr
jpablobr / tork_wrong_number_of_arguments.log
Created January 29, 2012 19:19
debugging tork with RUBYOPT=-d
jp@d: M|114m|master ttycoke RUBYOPT=-d tork
Exception `LoadError' at /home/jpablobr/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1243 - cannot load such file -- rubygems/defaults/operating_system
Exception `LoadError' at /home/jpablobr/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems.rb:1252 - cannot load such file -- rubygems/defaults/ruby
/home/jpablobr/.rvm/gems/ruby-1.9.3-p0/gems/tork-17.0.1/bin/tork:59: warning: assigned but unused variable - worker_number
Exception `NoMethodError' at /home/jpablobr/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1473 - undefined method `to_ary' for #<Gem::Specification name=json version=1.6.4>
Exception `NoMethodError' at /home/jpablobr/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1473 - undefined method `to_ary' for #<Gem::Specification name=json version=1.6.5>
Using Ext extension for JSON.
tork: Absorbing test execution overhead...
Exception `LoadError' at /home/jpablobr/.rvm/rub