Skip to content

Instantly share code, notes, and snippets.

View hienvd's full-sized avatar
🚀

Hien Vuong hienvd

🚀
  • ITviec
  • Ho Chi Minh City, Viet Nam
View GitHub Profile
@hienvd
hienvd / Tmux cheatsheet
Last active August 29, 2015 14:05
Tmux cheatsheet
Manage Sessions
tmux new -s session_name
>> creates a new tmux session named session_name
tmux attach -t session_name
>> attaches to an existing tmux session named session_name
tmux switch -t session_name
>> switches to an existing session named session_name
tmux list-sessions
>> lists existing tmux sessions
@hienvd
hienvd / Fix_sprockets_rails_s
Created October 30, 2015 11:35
Fix can not start rails server when upgrade sprockets to 2.12.3
Hi,
I got it sorted. Here is what I did to fix it:
I found a revision in the Sprockets Github repo
(https://github.com/sstephenson/sprockets/commit/743c1b1a6433195e440e2d863e5d4767cc41271a)
when searching for a fix for the undefined method error relating to
default_mime_type. I then applied this change to the following ruby
scripts
in the sprockets 2.11.0 gem directory: jst_processor, sass_compressor,
@hienvd
hienvd / jenkin.md
Last active April 17, 2017 04:04
Jenkins
@hienvd
hienvd / rvm.md
Last active April 18, 2017 09:59
RVM with non-root user

curl -sSL https://get.rvm.io | bash -s stable --path $HOME/.rvm

source /var/lib/non-user/.rvm/scripts/rvm

@hienvd
hienvd / haml_rails5.md
Created May 25, 2017 15:26
Using haml Rails 5
  1. install HAML Gemfile: add gem 'haml-rails' to Gemfile
  2. bundle
  3. run rake haml:erb2haml to convert all erb to haml files => has option to delete old erb files, but becareful :) that's all
@hienvd
hienvd / hexo.md
Created July 2, 2017 02:25
My Hexo docs

Create page

hexo new page "about"
hexo new page "404"
@hienvd
hienvd / react-setting-up.md
Last active September 27, 2017 16:13
Setting up a React Project

Init

npm init --y

Install React and ReactDom

npm install react react-dom --save-dev

Install Babel, webpack, webpack-dev-server

npm install babel-core babel-loader webpack webpack-dev-server --save-dev

Install ES2015 and React presets

@hienvd
hienvd / git_deleted_file_history.md
Created December 5, 2017 02:53
Find history of deleted file

List of all deleted files:

git log --diff-filter=D --summary | grep pattern_to_search

Find the log git log --all -- FILEPATH

@hienvd
hienvd / postgres_queries_and_commands.sql
Created February 22, 2021 11:35 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'