This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Git? | |
* what is git? | |
* Git basics | |
# Git usages | |
* git commands | |
* git tools | |
# Git tools | |
* SublimeText [https://sublimegit.net/](link) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
# Kill all the existing process with given name and for current user | |
user=whoami | |
for processid in `pgrep -U $user $1`; do | |
kill -9 $processid; | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gdshortener | |
from bottle import route, run, request | |
@route('/ping') | |
@route('/') | |
def index(): | |
return ''' | |
<form action="/url_shortener" method="post"> | |
URL : <input name="url" type="text" /> | |
<input value="Convert" type="submit" /> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROMPT='%{$fg_bold[green]%}%p %{$fg_bold[red]%}%% %{$reset_color%}' | |
local git_branch='$(git_prompt_status)%{$reset_color%}$(git_prompt_info)%{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="(" | |
ZSH_THEME_GIT_PROMPT_SUFFIX=")" | |
rvm_prompt='%{$fg[magenta]%}$(rvm-prompt r b g)%{$reset_color%}' | |
RPROMPT="%{$fg_bold[green]%}%c${rvm_prompt}|${git_branch}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo "Killing all instances found matching for "$1 | |
ps aux | grep $1 | awk '{print $2; system("kill -9 "$2"");}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias g="git" | |
alias gp="git pull --rebase" | |
alias gps="git push" | |
alias gs="git status --short" | |
alias gst="git status" | |
alias gcm="git commit -m" | |
alias gca="git commit -am" | |
alias gco="git checkout" | |
alias glog="git --no-pager log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" | |
alias m1="source ~/Sites/mongo-connect 1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'mysql_s3_backup' | |
class MysqlS3Dumper | |
attr_accessor :config | |
class MysqlS3Backup::Backup | |
def full(name=make_new_name) | |
lock do | |
# When the full backup runs it delete any binary log files that might already exist | |
# in the bucket. Otherwise the restore will try to restore them even though they’re | |
# older than the full backup. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function prompt_krao_precmd { | |
vcs_info | |
} | |
function prompt_krao_setup { | |
autoload -Uz vcs_info | |
add-zsh-hook precmd prompt_krao_precmd | |
zstyle ':vcs_info:*' enable git | |
zstyle ':vcs_info:*' check-for-changes true | |
zstyle ':vcs_info:*' unstagedstr '!' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'hpricot' | |
require 'open-uri' | |
class GetRailsCasts | |
def initialize | |
@host = "http://railscasts.com/episodes/" | |
end | |
def start | |
1.upto(231){ |eps| |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'hpricot' | |
require 'open-uri' | |
require 'work_queue' | |
dir = Dir.new("path/to/your/dir") | |
class DownloadWiki | |
def initialize | |
@locales = collect_locales | |
@host = "http://download.wikimedia.org/" |