Skip to content

Instantly share code, notes, and snippets.

View niquola's full-sized avatar

Nikolai Ryzhikov niquola

View GitHub Profile
echo "*~" >> ~/.gitignore
echo "*.sw?" >> ~/.gitignore
git config --global core.excludesfile ~/.gitignore
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
git config --global alias.br branch
git config --global user.name "nicola"
@niquola
niquola / rails31init.md
Created May 24, 2011 21:11 — forked from jraines/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, Devise, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@niquola
niquola / gitwitt.rb
Created November 12, 2011 02:04
send tweet message on commit
#!/usr/bin/env ruby
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
message = `git log --pretty=format:'%an: %s (%h)' -n 1`
require 'rubygems'
require 'twitter'
@niquola
niquola / rvm
Created November 29, 2011 23:13
rvm on ubuntu
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
#then
source ~/.rvm/scripts/rvm #in .zshrc
#then restart console
rvm list known
rvm install 1.9.3
rvm use 1.9.3 --default
@niquola
niquola / Generate tags for project
Created July 17, 2012 21:28
Generate tags for project
sudo apt-get install exuberant-ctags
group :development do
gem 'guard-ctags-bundler'
gem 'rb-readline'
end
guard init ctags-bundler
//see http://effectif.com/vim/using-ctags-with-bundler-gems
//to index gems on each bundle install
bundle show --paths | xargs ctags -R
@niquola
niquola / nosql.html
Created October 10, 2012 21:53
NosqlDistilledKeyNotest.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0052)http://martinfowler.com/articles/nosqlKeyPoints.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>NoSQL Key Points</title>
<!--<link href="./NoSQL Key Points_files/nosql-key-points.css" rel="stylesheet" type="text/css">-->
</head>
<style>
body, html { width:100%; background: #111; color: #eee;
font-family: arial;
line-height: 1.5em;
@niquola
niquola / gist:5221424
Created March 22, 2013 13:53
Run specs before git commit
rspec -X `git st | grep _spec.rb | awk '{print $3}'`
@niquola
niquola / gist:5221438
Created March 22, 2013 13:56
Linux adm: Find deleted files opened by some processes
lsof +L1
@niquola
niquola / gist:5246267
Last active December 15, 2015 10:29
ssh through gateway with key forwarding
ssh-add your-key
ssh -A -t user@host1 ssh -A -t user@host2
@niquola
niquola / gist:5269778
Created March 29, 2013 09:23
tmux config
# C-b is not acceptable -- Vim uses it
set-option -g prefix C-a
bind-key C-a last-window
# Start numbering at 1
set -g base-index 1
# Allows for faster key repetition
set -s escape-time 0