Skip to content

Instantly share code, notes, and snippets.

View Nimdis's full-sized avatar

Sergei Toroshchin Nimdis

View GitHub Profile
@Nimdis
Nimdis / gist:7478157
Created November 15, 2013 02:28
Disable/enable SQL logging for irb
old_logger = ActiveRecord::Base.logger
ActiveRecord::Base.logger = nil
@Nimdis
Nimdis / gist:7543051
Created November 19, 2013 10:00
Enabling/Disabling Line Numbers in Vim
:set nu
:set nonu
@Nimdis
Nimdis / gist:8554668
Created January 22, 2014 07:13
just install gems into ./~bundle
bundle install --path ~/.bundle --binstubs
@Nimdis
Nimdis / gist:8643654
Created January 27, 2014 05:27
erd pdf generating
rake erd filetype=pdf notation=bachman inheritance=true
@Nimdis
Nimdis / gist:8725803
Created January 31, 2014 02:48
looks for and replaces coincidences in all project
find {app,config}/ -type f | xargs grep 'education_exams'
find {app,config}/ -type f | xargs sed -i 's|education_exams|exams|g'
@Nimdis
Nimdis / gist:8909543
Created February 10, 2014 02:50
import a sql file to a database by rake and rail
rake db:drop && rake db:create && psql abiturient < tmp/pgsql_abiturient-201402070325-5.sql
@Nimdis
Nimdis / gist:9015195
Created February 15, 2014 06:09
This line changes an url of git
git remote set-url origin git://new.url.here
@Nimdis
Nimdis / gist:9031067
Created February 16, 2014 08:19
highlighting and other configs for git
[color]
diff = true
status = true
interactive = true
branch = true
[alias]
st = status
hist= log --all --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit
[push]
default = simple
@Nimdis
Nimdis / gist:9032462
Created February 16, 2014 10:55
undo last git push
git push -f origin HEAD^:master
@Nimdis
Nimdis / gist:9443470
Created March 9, 2014 06:02
If you are using postgresapp and have some troubles with installing gem pg on your mac os x mavericks, insert lines below into your .bundle/config file.
BUNDLE_BUILD__PG: -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config .