Skip to content

Instantly share code, notes, and snippets.

View tnhoang's full-sized avatar

Hoang Tran tnhoang

View GitHub Profile

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@tnhoang
tnhoang / cloudSettings
Last active August 30, 2021 13:24
Store personal VSCode settings
{"lastUpload":"2021-08-30T13:24:51.073Z","extensionVersion":"v3.4.3"}
New Plugin:
***commentary.vim > vjjgc
***vim-sort-motion > gs2j
shift C , Ctr y ,
" Fisa-vim-config
" http://fisadev.github.io/fisa-vim-config/
" version: 8.3.1
@tnhoang
tnhoang / revert-a-commit.md
Created April 13, 2018 01:44 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

" Fisa-vim-config
"
" version: 8.3.1
" ============================================================================
" Vim-plug initialization
" Avoid modify this section, unless you are very sure of what you are doing
let vim_plug_just_installed = 0
let vim_plug_path = expand('~/.vim/autoload/plug.vim')
import os
import sys
# The wget module
import wget
# The BeautifulSoup module
from bs4 import BeautifulSoup
# The selenium module
@tnhoang
tnhoang / vim_tmux_setup.sh
Created March 26, 2018 16:18 — forked from fideloper/vim_tmux_setup.sh
Setup Vim+Vundle+Solarized+Tmux in a Vagrant Ubuntu box. This goes with my article on Vim+Tmux here: http://fideloper.com/mac-vim-tmux
#!/usr/bin/env bash
# Bash script to automate Vim+Tmux install as written about here:
# http://fideloper.com/mac-vim-tmux
# Test if Git is installed.
# Installing Git is not the job of this script
git --version 2>&1 >/dev/null
GIT_IS_INSTALLED=$?