Skip to content

Instantly share code, notes, and snippets.

@fajrif
fajrif / gem_cheat_sheet
Created April 12, 2011 22:52
create gem with bundler
bundle gem <name> # => to create gem skeleton
gem build <name>.gemspec # => build the gem
gem push <name>.gem # => push the gem to rubygems.org
gem yank <name> -v VERSION # => to yanking the gems
@fajrif
fajrif / rvm_cheatsheet
Created June 14, 2011 14:11
RVM cheatsheet
RVM home page: http://rvm.beginrescueend.com
Install RVM
------------
See http://rvm.beginrescueend.com/rvm/install/
bash < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer)
Install rvm for all users
@fajrif
fajrif / my usual git command
Created June 23, 2011 12:25
my usual git command
git init
# => initialize local repository
git add .
# => add all files/folders into the staging area
git add -A
# => add all files/folders into the staging area
# => (include the changes in the entire tree)
@fajrif
fajrif / gist:1222825
Created September 16, 2011 18:59
update fork with original repo
git remote add <remote_name> <original-repo>
# => add remote refs named (whatever) to targeted the original repo
git fetch <remote_name>
git merge <remote_name>/<branch-name>
# => safely gathers any commits from original repo and stores them in your local repo
** if auto-merging conflict, use `git diff --color` to check/edit the files
and commit it first before push to the remote repo
@fajrif
fajrif / gist:1265203
Created October 5, 2011 18:12
git clone specific tag
git clone <repo-address>
git tag -l
git checkout <tag-name>
git branch -D master
git checkout -b master
@fajrif
fajrif / gist:1328735
Created October 31, 2011 20:10
git rm remote repo
# remove file from stage
git rm --cached --ignore-unmatch <filename>
# to remove the file from the entire repo history
git filter-branch --index-filter 'git rm --cached --ignore-unmatch <filename>' HEAD
# to force update to remote repo, so the remote repo have the same history
[user]
name = Fajri Fachriansyah
email = [email protected]
[alias]
co = checkout
c = config --list
b = branch
d = diff --color
ds = diff --stat --color
s = status
@fajrif
fajrif / ajaxify-html5.js
Created February 6, 2012 04:43 — forked from balupton/README.md
Ajaxify a Website with the HTML5 History API using History.js, jQuery and ScrollTo
// https://gist.github.com/854622
(function(window,undefined){
// Prepare our Variables
var
History = window.History,
$ = window.jQuery,
document = window.document;
// Check to see if History.js is enabled for our Browser
@fajrif
fajrif / vim macros
Created September 20, 2012 11:36
APKT perubahan data export script
[DirectMethod]
public void BuildReport(string gridID)
{
try
{
if (((DataSet)Session["DaftarLaporLebih1Kali"]).Tables.Contains(gridID))
{
string HTMLoutput;
String xml = ((DataSet)Session["DaftarLaporLebih1Kali"]).GetXml();
xml = "<?xml version='1.0' encoding='utf-8'?>\n" + xml;
@fajrif
fajrif / .gitconfig
Last active February 9, 2016 06:32
[user]
name = Fajri Fachriansyah
email = [email protected]
[alias]
co = checkout
c = config --list
b = branch
d = diff --color
ds = diff --stat --color
s = status