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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
# | |
source ~/.git-completion.bash |
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
[user] | |
name = Nelson Minor Haraguchi Jr. | |
email = nelsonmhjr@gmail.com | |
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow |
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
*~ | |
*.swp | |
*thumbs.db | |
config/database.yml | |
doc/app* | |
doc/api* | |
doc/* | |
log/*.log | |
tmp/**/* | |
tmp/* |
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
require 'rubygems' | |
require 'wirble' | |
Wirble.init(:skip_prompt => true, :skip_history => true) | |
Wirble.colorize | |
def history(how_many = 50) | |
history_size = Readline::HISTORY.size |
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
<?php | |
echo '<pre>'; | |
// Outputs all the result of shellcommand "ls", and returns | |
// the last output line into $last_line. Stores the return value | |
// of the shell command in $retval. | |
$last_line = system('ping localhost -c1', $retval); | |
// Printing additional info | |
echo ' |
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
class RomanToNum | |
def convert(roman) | |
roman = roman.chars.to_a | |
if roman[0].nil? | |
0 | |
elsif roman.size == 1 | |
to_num(roman.shift) | |
elsif to_num(roman[0]) < to_num(roman[1]) | |
-to_num(roman.shift) + convert(roman.join) | |
else |
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["RAILS_ENV"] ||= 'test' | |
require 'rubygems' | |
require 'spork' | |
Spork.prefork do | |
# Loading more in this block will cause your tests to run faster. However, | |
# if you change any configuration or code from libraries loaded here, you'll | |
# need to restart spork for it take effect. | |
# This file is copied to ~/spec when you run 'ruby script/generate rspec' |
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
versions = Dir[File.join('/home/nelson/.rvm/rubies', "ruby*")] | |
versions.each do |version| | |
version.match(/-([\d\.]\+)-/) | |
ruby_version_string = version.split('/').last | |
ruby_version = $1 | |
ENV['GEM_PATH'] = Dir["/home/nelson/.rvm/gems/#{ruby_version_string}*/"].join(':') |
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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
# |
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
Vim #ftw but manage vim plugins is not a task that I like. | |
Let's change that: | |
A Fake bash commands: | |
$ vim-apt list | |
$ vim-apt update # Update and see new versions of that package (like apt-get update) |
OlderNewer