Skip to content

Instantly share code, notes, and snippets.

@thongnguyenhuu
thongnguyenhuu / .zshrc
Last active May 15, 2021 09:12
Zsh config
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@thongnguyenhuu
thongnguyenhuu / setup-ubuntu.sh
Last active April 16, 2022 04:29
Setup ubuntu with one command
sudo apt update
# Install zsh if not existed
if ! which zsh > /dev/null
then
echo "===> INSTALL zsh"
sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
echo 'exec zsh' >> ~/.bashrc
fi
@thongnguyenhuu
thongnguyenhuu / .bashrc
Last active March 11, 2020 01:35
Bash config
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
@thongnguyenhuu
thongnguyenhuu / gist:f33e0e02ed7ce9b26a92
Created October 12, 2015 02:06 — forked from clintongormley/gist:4095280
Using synonyms in Elasticsearch

We create an index with:

  • two filters: synonyms_expand and synonyms_contract
  • two analyzers: synonyms_expand and synonyms_contract
  • three text fields:
    • text_1 uses the synonyms_expand analyzer at index and search time
    • text_2 uses the synonyms_expand analyzer at index time, but the standard analyzer at search time
    • text_3 uses the synonyms_contract analyzer at index and search time

.

@thongnguyenhuu
thongnguyenhuu / install-monaco-font.sh
Created April 19, 2015 04:13
Install `Monaco` font for ubuntu
#!/bin/bash
#script extraido de: http://paulocassiano.wordpress.com/2008/08/29/deixando-o-gedit-com-a-cara-do-textmate/
#tip for better "resolution" here: http://blog.siverti.com.br/2008/05/22/fonte-monaco-no-ubuntugedit/
cd /usr/share/fonts/truetype/
#TODO: put validation if folder already exists
sudo mkdir ttf-monaco
@thongnguyenhuu
thongnguyenhuu / setup-ubuntu.sh
Last active January 23, 2023 13:27
Bash script for setup ubuntu #ubuntu #setup
#!/usr/bin/env bash
# Installing git
sudo apt-get install git -y
# Installing NodeJS
sudo apt-get install curl
curl -sL https://deb.nodesource.com/setup | sudo bash -
sudo apt-get install -y nodejs
@thongnguyenhuu
thongnguyenhuu / ST3 setting
Last active November 27, 2015 01:20
Setting for Sublime text 3 #st3
{
"always_show_minimap_viewport": true,
"auto_complete_delay": 500,
"bold_folder_labels": true,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
"copy_with_empty_selection": false,
"detect_indentation": false,
"detect_slow_plugins": false,
"draw_minimap_border": true,
"ensure_newline_at_eof_on_save": true,
@thongnguyenhuu
thongnguyenhuu / Istalling-packages-ST3
Last active November 27, 2015 01:20
Installing package for sublime text 3. Put it in Preference/Package Setting/Package Control/Setting - User
{
"in_process_packages":
[
],
"installed_packages":
[
"Alignment",
"BracketHighlighter",
"DocBlockr",
"EditorConfig",