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
#!/bin/bash | |
# Creates a shiny prompt that integrates well with git | |
# Load up my script that lets me set colors much easier | |
source bashrgb | |
# Load my prompt helpers that make a lot of this voodoo easier to do | |
source prompt_helpers | |
# pulls information from git to display in the prompt |
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
#!bash | |
# | |
# bash/zsh completion support for core Git. | |
# | |
# Copyright (C) 2006,2007 Shawn O. Pearce <[email protected]> | |
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/). | |
# Distributed under the GNU General Public License, version 2.0. | |
# | |
# The contained completion routines provide support for completing: | |
# |
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
#!/bin/bash | |
# Just some stuff to make writing prompts easier | |
# Set a Terminal's title with this, saves a lot of weird strings from the prompts | |
function title { echo -ne "\\033]0;$*\007"; } | |
# Gets the present working directory and returns just the last 2 directories, good for shortening titles and prompts | |
function PWD { tmp=${PWD%/*/*}; [ ${#tmp} -gt 0 -a "$tmp" != "$PWD" ] && echo ${PWD:${#tmp}+1} || echo $PWD; } | |
# Does the same thing, but for any path | |
function shortpath { tmp=${1%/*/*}; [ ${#tmp} -gt 0 -a "$tmp" != "$1" ] && echo ${1:${#tmp}+1} || echo $1; } |
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
#!/bin/sh | |
# defined colors to make it easier to output visually stimulating prompts and other messages | |
# escapes the arguments you send it | |
function esc () { echo -ne "\\033[$*"; } | |
# color code escapes your first argument then follows with the rest of them | |
function escc () { echo -ne "\\033[$1m$2 $3 $4 $5 $6 $7 $8 $9"; } | |
# basic color escapes | |
function c () { echo -ne "\\033[$1m"; } | |
function fg () { echo -ne "\\033[0;$1m"; } |
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
Autotest.add_hook :initialize do |autotest| | |
%w{.git .svn .hg .DS_Store ._* vendor tmp log doc tag TAG TAGS tags *.orig Gemfile.lock}.each do |exception| | |
autotest.add_exception(exception) | |
end | |
end |
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
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto | |
ui = auto | |
pager = true | |
[color "branch"] | |
current = yellow reverse |
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
public # call from anywhere | |
protected # call from inside instance of a class | |
private # only call implicitly from instance | |
Constants # Not inherited, not changed | |
@@class_variables # Inherited, changeable | |
# Changes all sub and super classe as well!! |
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
my_new_array = Array.new 5 | |
my_new_array.map! do | |
Array.new(5).map do | |
:placeholder | |
end | |
end | |
p my_new_array |
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
pry(main)> x = "" | |
=> "" | |
pry(main)> cd x | |
pry(""):1> show-doc chars | |
From: string.c in Ruby Core (C Method): | |
Number of lines: 11 | |
visibility: public | |
signature: chars() |
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
sudo apt-get install ncurses-term |