Skip to content

Instantly share code, notes, and snippets.

@smathy
Last active September 3, 2015 22:25
Show Gist options
  • Save smathy/221029 to your computer and use it in GitHub Desktop.
Save smathy/221029 to your computer and use it in GitHub Desktop.
Various config files for Rails, github, etc..
--type-add=ruby=.haml,sass=.sass
[core]
excludesfile = /Users/jk/.gitignore
editor = mvim -f -U ~/.gvimrc_git
autocrlf = false
whitespace = fix
[color]
ui = auto
[alias]
co = checkout
br = branch
ci = commit
m = checkout master
rr = reset --hard origin/master
d = diff --color-words
s = show --color-words
sign = commit --amend -sC HEAD
amend = commit --amend -C HEAD
l = log --graph --date=short --pretty='format:%C(green)%ad %C(yellow)%h%Creset %C(cyan)%aN (%cN)%Creset %s%C(magenta bold)%d%Creset'
ll = log --decorate --pretty=full --shortstat --abbrev-commit --dirstat
la = log --decorate --pretty=full --stat --abbrev-commit --name-status
p = format-patch master
st = status -sb
cp = cherry-pick
b = checkout -b
[bananajour]
hostname = jason.ao.dev
[push]
default = tracking
[branch]
autosetuprebase = local
.tags
.*.sw?
.DS_Store
log/*
index/*
db/*.sqlite3
tmp
*.gem
*.swf
require 'irb/completion'
require 'pp'
if ENV['RAILS_ENV']
load File.join( File.dirname(__FILE__), '.railsrc')
end
require 'yaml'
require 'rubygems'
def v(x)
IO.popen( 'mvim -', 'w') do |io|
io.puts x.to_yaml
end
end
def less(x)
IO.popen( 'less -', 'w') do |io|
io.puts x.to_yaml
end
end
# vim: set ft=ruby:
## EXAMPLES ONLY (from SEE)
def x_cu
Person.current_user_id = Student.current_user_id = Parenthood.current_user_id = Guardianship.current_user_id = User.current_user_id = 0
end
def x_wash
x_cu
Person.all.each do |p|
p.date_of_birth += rand(60).days unless p.date_of_birth.blank?
if nx = Person.find_by_id(p.id + 1)
p.first_name = nx.first_name
nx.paternal_surname = p.paternal_surname
p.save!
nx.save
end
end
end
def x_reset_passwords
x_cu
User.all(:conditions=>'id!=0').each{|u|u.password=u.password_confirmation='CambiemePorFavor';u.save!}
end
def x_fu(login = 'eduardo')
User.first(:conditions => ['login like ?', login + "%"])
end
#!/bin/sh
open `git config -l | sed -En 's/remote.origin.url=git(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\3\/\4/p'`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment