JasonKing (owner)

Revisions

gist: 221029 Download_button fork
public
Description:
Various config files for Rails, github, etc..
Public Clone URL: git://gist.github.com/221029.git
Embed All Files: show embed
~/.ackrc #
1
--type-add=ruby=.haml,sass=.sass
~/.gitignore #
1
2
3
4
5
6
7
8
9
10
.tags
.*.sw?
.DS_Store
log/*
index/*
db/*.sqlite3
tmp
*.gem
*.swf
 
~/.irbrc #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
~/.railsrc #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# 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/gh.sh #
1
2
3
4
#!/bin/sh
 
open `git config -l | sed -En 's/remote.origin.url=git(@|:\/\/)github.com(:|\/)(.+)\/(.+).git/https:\/\/github.com\/\3\/\4/p'`