Skip to content

Instantly share code, notes, and snippets.

View buithehoa's full-sized avatar
🐢
Moving slowly ...

Bùi Thế Hòa buithehoa

🐢
Moving slowly ...
View GitHub Profile
@buithehoa
buithehoa / delete-a-remote-branch
Created November 11, 2015 02:25
Delete a remote branch
git push origin --delete <branch-name>
@buithehoa
buithehoa / show-remote-branches
Created November 11, 2015 01:44
Show remote branches
git fetch <remote-name>
git branch -r
@buithehoa
buithehoa / replace-all-non-alphanumeric-characters.rb
Created November 8, 2015 14:44
Replace all non-alphanumeric characters
"foo bar".downcase.gsub(/[^\p{Alnum}]/, '-') # Output: foo-bar
@buithehoa
buithehoa / create-a-tar-gz-file
Last active November 11, 2015 09:07
Create a tar.gz file
tar zcvf archive-name.tar.gz source-folder-name
@buithehoa
buithehoa / create-and-track-a-remote-branch
Created November 3, 2015 02:17
Create and track a remote branch
$ git checkout -b your_branch
$ git push -u origin your_branch
@buithehoa
buithehoa / delete-blank-lines-in-vim
Created October 7, 2015 07:28
Delete blank lines in vim
:g/^$/d
@buithehoa
buithehoa / extract-a-bz2-file
Created September 30, 2015 09:22
Extract a .bz2 file
bzip2 -d <filename>.bz2
@buithehoa
buithehoa / save-postgresql-output-to-csv.sql
Created September 22, 2015 09:36
Save PostgreSQL output to CSV
COPY (SELECT * FROM foo) T0 '/tmp/foo.csv' WITH CSV;
@buithehoa
buithehoa / extract-a-gz-file
Created September 8, 2015 02:57
Extract a .gz file
gzip -d <filename>.gz
@buithehoa
buithehoa / clear-all-jobs-from-sidekiq.rb
Created August 26, 2015 15:33
Clear all jobs from sidekiq
require 'sidekiq/api'
Sidekiq::Queue.new.clear