Skip to content

Instantly share code, notes, and snippets.

@hugocorbucci
hugocorbucci / keybase.md
Created February 12, 2020 14:18
Keybase verification

Keybase proof

I hereby claim:

  • I am hugocorbucci on github.
  • I am hugocorbucci (https://keybase.io/hugocorbucci) on keybase.
  • I have a public key ASCCRRc06MKtSPa7kUkX85DWrBNZgqrvP7-vWUaM-5y4MAo

To claim this, I am signing this object:

@hugocorbucci
hugocorbucci / extract_session_info_by_year.rb
Created April 10, 2016 04:19
Extracting proposal information for a number of years from the submissions systems for Agile Alliance Brazil and convert to CSV
#!/usr/bin/env ruby
# encoding: UTF-8
if ARGV.size < 1
puts "Usage: #{__FILE__} <list of years separated by space>"
puts "<list of years separated by space>\t\tFor each year we care."
puts "Examples:"
puts "#{__FILE__} 2015 - Gets the info of the sessions submitted for the 2015 conference."
puts "#{__FILE__} 2015 2014 2013 - Gets the info of the sessions submitted for the conferences between 2013 and 2015."
exit 1
end
@hugocorbucci
hugocorbucci / copy_dvd.sh
Created March 12, 2016 17:08
Little script (OSX) to help create multiple copies of a given DVD
#!/usr/bin/env bash
set -e
NUMBER_OF_COPIES=$1
if [ -z $NUMBER_OF_COPIES ]; then
NUMBER_OF_COPIES=1
fi
IMAGE_PATH="/tmp/image.iso"
echo "Copying ${NUMBER_OF_COPIES} copies of the DVD inserted or the image in ${IMAGE_PATH} if it exists"
@hugocorbucci
hugocorbucci / network-monitor.sh
Created January 1, 2013 21:32
Network monitor Very useful for unstable connections when you want to know whether your connection is up or down
#!/bin/sh
HOST=4.2.2.2
INTERVAL=5
FIRST_CONNECTED_MESSAGE="Fantastic. Speedy is working."
FIRST_DISCONNECTED_MESSAGE="Boo. No Internet."
CONNECTED_MESSAGE="Yeah! We're back Online. I repeat: We're back online."
DISCONNECTED_MESSAGE="Boo. Lost Internet. I repeat: Lost Internet."
announce() {
echo "[`date +%Y-%m-%d\ %H:%M:%S`]: $*"
class Ability
include CanCan::Ability
def initialize(user)
user ||= User.new # guest
alias_action :edit, :update, :destroy, :to => :modify
can(:read, :all)
can(:manage, UserSession)
VALID_NAME=/[a-zA-Z][\w\!\?]*/
ANY_VARIABLE=/(#{VALID_NAME})[^(?:\()(?: \w)]/
module Rfactor
class CodeInspector
def initialize(code)
@instructions = code.split(/[\n;]/).map{|instruction| parenthise(instruction.strip)}
end
def external_variables