-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Victor Castell
committed
Oct 20, 2010
0 parents
commit b5f3f0f
Showing
101 changed files
with
17,089 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
Copyright (c) 2009 Ryan Bates | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
"Software"), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
= victorcoder Dot Files | ||
|
||
These are config files to set up a system the way I like it. | ||
|
||
|
||
== Installation | ||
|
||
git clone git://github.com/victorcoder/dotfiles ~/.dotfiles | ||
cd ~/.dotfiles | ||
rake install |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
require 'rake' | ||
require 'erb' | ||
|
||
desc "install the dot files into user's home directory" | ||
task :install do | ||
replace_all = false | ||
Dir['*'].each do |file| | ||
next if %w[Rakefile README.rdoc LICENSE].include? file | ||
|
||
if File.exist?(File.join(ENV['HOME'], ".#{file.sub('.erb', '')}")) | ||
if File.identical? file, File.join(ENV['HOME'], ".#{file.sub('.erb', '')}") | ||
puts "identical ~/.#{file.sub('.erb', '')}" | ||
elsif replace_all | ||
replace_file(file) | ||
else | ||
print "overwrite ~/.#{file.sub('.erb', '')}? [ynaq] " | ||
case $stdin.gets.chomp | ||
when 'a' | ||
replace_all = true | ||
replace_file(file) | ||
when 'y' | ||
replace_file(file) | ||
when 'q' | ||
exit | ||
else | ||
puts "skipping ~/.#{file.sub('.erb', '')}" | ||
end | ||
end | ||
else | ||
link_file(file) | ||
end | ||
end | ||
end | ||
|
||
def replace_file(file) | ||
system %Q{rm -rf "$HOME/.#{file.sub('.erb', '')}"} | ||
link_file(file) | ||
end | ||
|
||
def link_file(file) | ||
if file =~ /.erb$/ | ||
puts "generating ~/.#{file.sub('.erb', '')}" | ||
File.open(File.join(ENV['HOME'], ".#{file.sub('.erb', '')}"), 'w') do |new_file| | ||
new_file.write ERB.new(File.read(file)).result(binding) | ||
end | ||
else | ||
puts "linking ~/.#{file}" | ||
system %Q{ln -s "$PWD/#{file}" "$HOME/.#{file}"} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
:verbose: true | ||
gem: --no-ri --no-rdoc | ||
:update_sources: true | ||
:sources: | ||
- http://gems.rubyforge.org | ||
- http://gems.github.com | ||
:backtrace: false | ||
:bulk_threshold: 1000 | ||
:benchmark: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
[user] | ||
name = <%= print("Your Name: "); STDOUT.flush; STDIN.gets.chomp %> | ||
email = <%= print("Your Email: "); STDOUT.flush; STDIN.gets.chomp %> | ||
[color] | ||
branch = auto | ||
diff = auto | ||
interactive = auto | ||
status = auto | ||
ui = true | ||
[color "branch"] | ||
current = yellow reverse | ||
local = yellow | ||
remote = green | ||
[alias] | ||
br = branch | ||
branches = branch -a -v | ||
ci = commit | ||
co = checkout | ||
diffm = !git diff | mate | ||
incoming = !sh -c 'git fetch && git log ..origin' | ||
tree = log --graph --prettyfor ($i = 0; $imat:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative | ||
st = status | ||
tags = tag -n1 | ||
tip = log -n 1 --stat --no-merges | ||
outgoing = diff master origin/master | ||
pick = cherry-pick | ||
undo = !sh -c 'git reset --soft HEAD^ && git reset HEAD && git status' | ||
undomerge = reset --hard ORIG_HEAD | ||
unstage = reset HEAD | ||
pu = !"git fetch origin -v; git fetch upstream -v; git merge upstream/master" | ||
[core] | ||
excludesfile = <%= ENV['HOME'] %>/.gitignore | ||
editor = vim | ||
[github] | ||
user = <%= print("GitHub Username: "); STDOUT.flush; STDIN.gets.chomp %> | ||
token = <%= print("GitHub API Token: "); STDOUT.flush; STDIN.gets.chomp %> | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
# /sites/default/files/imagecache/ | ||
/sites/default/files/imagecache/* | ||
|
||
# /sites/default/files/imagefield_thumbs/ | ||
/sites/default/files/imagefield_thumbs/* | ||
|
||
/sites/default/tmp/* | ||
|
||
.~lock.* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
" Example Vim graphical configuration. | ||
" Copy to ~/.gvimrc or ~/_gvimrc. | ||
|
||
set guifont=Inconsolata:h20 " Font family and font size. | ||
set antialias " MacVim: smooth fonts. | ||
set encoding=utf-8 " Use UTF-8 everywhere. | ||
set guioptions-=T " Hide toolbar. | ||
set background=light " Background. | ||
set lines=25 columns=100 " Window dimensions. | ||
|
||
set guioptions-=r " Don't show right scrollbar | ||
|
||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#!/usr/bin/ruby | ||
require 'irb/completion' | ||
require 'irb/ext/save-history' | ||
|
||
IRB.conf[:SAVE_HISTORY] = 1000 | ||
IRB.conf[:HISTORY_FILE] = "#{ENV['HOME']}/.irb_history" | ||
|
||
IRB.conf[:PROMPT_MODE] = :SIMPLE | ||
|
||
%w[rubygems looksee/shortcuts wirble].each do |gem| | ||
begin | ||
require gem | ||
rescue LoadError | ||
end | ||
end | ||
|
||
class Object | ||
# list methods which aren't in superclass | ||
def local_methods(obj = self) | ||
(obj.methods - obj.class.superclass.instance_methods).sort | ||
end | ||
|
||
# print documentation | ||
# | ||
# ri 'Array#pop' | ||
# Array.ri | ||
# Array.ri :pop | ||
# arr.ri :pop | ||
def ri(method = nil) | ||
unless method && method =~ /^[A-Z]/ # if class isn't specified | ||
klass = self.kind_of?(Class) ? name : self.class.name | ||
method = [klass, method].compact.join('#') | ||
end | ||
system 'ri', method.to_s | ||
end | ||
end | ||
|
||
def copy(str) | ||
IO.popen('pbcopy', 'w') { |f| f << str.to_s } | ||
end | ||
|
||
def copy_history | ||
history = Readline::HISTORY.entries | ||
index = history.rindex("exit") || -1 | ||
content = history[(index+1)..-2].join("\n") | ||
puts content | ||
copy content | ||
end | ||
|
||
def paste | ||
`pbpaste` | ||
end | ||
|
||
load File.dirname(__FILE__) + '/.railsrc' if $0 == 'irb' && ENV['RAILS_ENV'] |
Binary file not shown.
Oops, something went wrong.