Skip to content

Instantly share code, notes, and snippets.

View kxhitiz's full-sized avatar
:octocat:
{ hello: world }

Kshitiz Gurung kxhitiz

:octocat:
{ hello: world }
View GitHub Profile
/* Flatten das boostrap */
.well, .navbar-inner, .popover, .btn, .tooltip, input, select, textarea, pre, .progress, .modal, .add-on, .alert, .table-bordered, .nav>.active>a, .dropdown-menu, .tooltip-inner, .badge, .label, .img-polaroid {
-moz-box-shadow: none !important;
-webkit-box-shadow: none !important;
box-shadow: none !important;
-webkit-border-radius: 0px !important;
-moz-border-radius: 0px !important;
border-radius: 0px !important;
border-collapse: collapse !important;
background-image: none !important;
@kxhitiz
kxhitiz / gist:5694435
Last active December 18, 2015 00:09
My Vim Commands
Surround:
yss" - surround whole line with "
ysiw" - surround a word with "
cs'" - replace surround - with "
ds" - delete surround "
Tabs:
@kxhitiz
kxhitiz / gist:5624776
Created May 22, 2013 02:11
Github Cheatsheets
## Clone that specific branch
git init
git remote add -t $BRANCH -f origin $REMOTE_REPO
git checkout $BRANCH
@kxhitiz
kxhitiz / gist:5081924
Created March 4, 2013 12:23
Forever remove files or folders from git history
# remove all paths passed as arguments from the history of the repo
files=$@
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch $files" HEAD
# remove the temporary history git-filter-branch otherwise leaves behind for a long time
rm -rf .git/refs/original/ && git reflog expire --all && git gc --aggressive --prune
@kxhitiz
kxhitiz / gist:4952218
Created February 14, 2013 11:26
HTTParty Header Token Authentication
HTTParty.get "http://localhost:3000/teams.json", :headers=>{"Authorization"=>"Token token=\"a8d8ce14d2402a2e1912c25f39df770b\""}
@kxhitiz
kxhitiz / gist:4944126
Last active December 13, 2015 16:58
Using Mongoid with Rspec
#Using Mongoid with Rspec
#To prep for Rspec, make your gemfile look like this (Assuming Rails 3.x):
gem 'rspec-rails', :group => [:test, :development]
group :test do
gem 'database_cleaner'
end
#Run: bundle install rails g rspec:install
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@kxhitiz
kxhitiz / gist:4555231
Created January 17, 2013 11:06
remove all local branch except master
git branch -D `git branch | awk '{ if ($0 !~ /master/) printf "%s", $0 }'`
sudo apt-get build-dep tmux
git clone https://github.com/ThomasAdam/tmux.git
cd tmux/trunk
./autogen.sh
./configure --prefix=/usr/local
make
@kxhitiz
kxhitiz / vps_deployement
Last active October 13, 2015 06:48
deployment commands
Requires Ruby 1.9.2 or higher.
## Local Commands
```
rails new blog -d postgresql
rails g scaffold article name content:text
# setup server (below) with "ssh [email protected]"