Skip to content

Instantly share code, notes, and snippets.

@shihgianlee
shihgianlee / gist:1095486
Created July 20, 2011 17:52
RedBridge for Nokogiri
package canna;
/**
* modified after yokolet - http://gist.github.com/424212
*/
import java.util.Arrays;
import java.util.List;
import org.jruby.embed.LocalContextScope;
$ env LD_LIBRARY_PATH=/opt/local/lib jruby -J-d64 asm_test.rb
disassembly:
mov rax, 0xdeadbeef
ret
function returns: deadbeef
def print_right_half_triangle(num_of_rows)
count = 0
last_count = 0
for i in 1..num_of_rows
for j in 1..i
last_count = count + j
print last_count.to_s + " "
end
puts "\n"
count = last_count
c_cyan=`tput setaf 4`
c_red=`tput setaf 1`
c_green=`tput setaf 2`
c_yellow=`tput setaf 3`
c_sgr0=`tput sgr0`
c_bold=`tput bold`
bldblu='\e[1;34m' # Blue
current_git_branch ()
#!/usr/bin/env bash
# Usage:
# ./git_move.sh git@repo_site.com:/my_repo.git origin/folder/path/ /destination/repo/path/ new/folder/path/
repo=$1
folder=$2
dest_repo=$3
dest_folder=$4
clone_folder='__git_clone_repo__'