This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package canna; | |
/** | |
* modified after yokolet - http://gist.github.com/424212 | |
*/ | |
import java.util.Arrays; | |
import java.util.List; | |
import org.jruby.embed.LocalContextScope; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ env LD_LIBRARY_PATH=/opt/local/lib jruby -J-d64 asm_test.rb | |
disassembly: | |
mov rax, 0xdeadbeef | |
ret | |
function returns: deadbeef |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 () |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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__' |