Skip to content

Instantly share code, notes, and snippets.

View izidorome's full-sized avatar
👾
Typing...

Rafael Izidoro izidorome

👾
Typing...
View GitHub Profile
@izidorome
izidorome / post-checkout
Created November 5, 2015 16:24
bootstrap configs
#!/usr/bin/env ruby
def rebuild_config_files
root_repo_dir = `git rev-parse --show-toplevel`.chomp
change_branch = '1'
if ARGV[2] == change_branch
puts 'Rebuilding config files...'
`#{root_repo_dir}/scripts/bootstrap_configs`
end
end
@izidorome
izidorome / history.txt
Last active October 2, 2015 13:27 — forked from unak/history.txt
The History of Ruby
* Only the releases of the stable versions are enumerated in principle. The releases of the unstable versions especially considered to be important are indicated as "not stable."
* The branches used as the source of each releases are specified, and the branching timing of them are also shown. BTW, before subversionizing of the repository, the term called "trunk" was not used, but this list uses it in order to avoid confusion.
* In order to show a historical backdrop, big conferences (RubyKaigi, RubyConf and Euruko) are also emurated. About the venues of such conferences, general English notations are adopted, in my hope.
* ruby_1_8_7 branch was recut from v1_8_7 tag after the 1.8.7 release becaouse of an accident.
* 1.2.1 release was canceled once, and the 2nd repelase called "repack" was performed. Although there were other examples similar to this, since the re-releases were performed during the same day, it does not write clearly in particular.
* Since 1.0 was released with the date in large quantities
@izidorome
izidorome / clear_untracked_branchs.sh
Created August 7, 2015 11:47
Clear Untracked Branchs
#!/bin/bash
# Removel all local branchs whitch there is no link with remote repository.
# Take care! It can remove branchs you have created but yet haven't linked with a remote branch.
function clear_untracked_branchs {
if [ -d "$(pwd)/.git" ]; then
git pull
git remote update origin --prune
git branch | grep -v 'master' | grep -v '*' | sort | while read -r branch ; do
if [ !$(git branch -r --list *$branch) ] ; then

How to install PhantomJS on Ubuntu

Version: 1.9.8

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
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
RSpec.configure do |config|
config.before(:suite) do
DatabaseCleaner.clean_with(:truncation)
end
config.before(:each) do
DatabaseCleaner.strategy = :transaction
end
config.before(:each, js: true) do
@izidorome
izidorome / fuck
Last active August 29, 2015 14:13 — forked from stefanpenner/fuck
#!/usr/bin/env ruby
# coding: utf-8
abort "Usage: fuck you <name>" unless ARGV[0] == "you" && ARGV.size == 2
a = "abcdefghijklmnopqrstuvqxyz".each_char.to_a
b = "ɐqɔpǝɟƃɥıɾʞʃɯuodbɹsʇnʌʍxʎz".each_char.to_a
ws = Hash[a.zip(b)]
ws.default = ->(f){f}

Port Forwarding in Mavericks


Since Mavericks stopped using the deprecated ipfw (as of Mountain Lion), we'll be using pf to allow port forwarding.

####1. anchor file Create an anchor file under /etc/pf.anchors/<anchor file> with your redirection rule like: