Skip to content

Instantly share code, notes, and snippets.

View nathmisaki's full-sized avatar

Nathalia Misaki nathmisaki

View GitHub Profile
# ~/.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
[user]
name = Nelson Minor Haraguchi Jr.
email = nelsonmhjr@gmail.com
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
*~
*.swp
*thumbs.db
config/database.yml
doc/app*
doc/api*
doc/*
log/*.log
tmp/**/*
tmp/*
require 'rubygems'
require 'wirble'
Wirble.init(:skip_prompt => true, :skip_history => true)
Wirble.colorize
def history(how_many = 50)
history_size = Readline::HISTORY.size
<?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 '
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
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'
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(':')
@nathmisaki
nathmisaki / .bashrc
Created September 17, 2010 15:19
BashRC
# ~/.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
#
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)