Skip to content

Instantly share code, notes, and snippets.

View ngtrvu's full-sized avatar
🚀

Vu Nguyen ngtrvu

🚀
View GitHub Profile
@ngtrvu
ngtrvu / .zshrc
Last active August 20, 2024 15:32
~/.zshrc
# vim
alias vim="nvim"
alias vi="nvim"
alias oldvim="vim"
# 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,
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"terminal.integrated.inheritEnv": false,
"terminal.integrated.fontSize": 13,
"go.toolsManagement.autoUpdate": true,
"editor.fontSize": 13,
"debug.console.fontSize": 13,
"editor.detectIndentation": false,
"editor.insertSpaces": true,
"editor.tabSize": 2,
The MIT License (MIT)
Copyright (c) 2013 Jamar Parris
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S
@ngtrvu
ngtrvu / NERDTree.mkd
Created December 9, 2021 17:30 — forked from m3nd3s/NERDTree.mkd
My Vim Cheat Sheet

NERDTree

o.......Open files, directories and bookmarks....................|NERDTree-o|
go......Open selected file, but leave cursor in the NERDTree.....|NERDTree-go|
t.......Open selected node/bookmark in a new tab.................|NERDTree-t|
T.......Same as 't' but keep the focus on the current tab........|NERDTree-T|
i.......Open selected file in a split window.....................|NERDTree-i|
gi......Same as i, but leave the cursor on the NERDTree..........|NERDTree-gi|
s.......Open selected file in a new vsplit.......................|NERDTree-s|
gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|

O.......Recursively open the selected directory..................|NERDTree-O|

@ngtrvu
ngtrvu / test_image_upload.py
Created February 5, 2020 07:42 — forked from guillaumepiot/test_image_upload.py
Django Rest Framework - Image/File upload test
import os
import io
from PIL import Image
from django.core.urlresolvers import reverse
from django.conf import settings
from rest_framework import status
from rest_framework.test import APITestCase
@ngtrvu
ngtrvu / iterm2.md
Created March 29, 2018 05:30 — forked from squarism/iterm2.md
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Fullscreen + Enter
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
@ngtrvu
ngtrvu / default.conf
Created January 23, 2018 09:05 — forked from mattes/default.conf
redash.io setup
upstream redash {
server redash:5000;
}
server {
listen 80;
location / {
return 301 https://$host$request_uri;
}
@ngtrvu
ngtrvu / nginx.conf
Created January 23, 2018 08:21 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ngtrvu
ngtrvu / nginx
Last active January 23, 2018 08:20
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@ngtrvu
ngtrvu / gist:98c8e2448e4dfb25f219a9c5327f9fda
Last active September 29, 2017 03:09 — forked from sunboy-2050/gist:9543963
python implement redis publish and subscribe
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import time
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):
threading.Thread.__init__(self)