Skip to content

Instantly share code, notes, and snippets.

View remynguyen96's full-sized avatar
🌳
Plant Trees

Chau Nguyen remynguyen96

🌳
Plant Trees
  • Ho Chi Minh City
  • 11:33 (UTC +07:00)
View GitHub Profile
@remynguyen96
remynguyen96 / otp.js
Last active July 7, 2018 04:13
HMAC-SHA-512
function binb2rstr(input) {
var i, l = input.length * 32,
output = '';
for (i = 0; i < l; i += 8) {
output += String.fromCharCode((input[i >> 5] >>> (24 - i % 32)) & 0xFF);
}
return output;
}
function rstr2binb(input) {
@remynguyen96
remynguyen96 / Dockerfile
Last active October 5, 2018 13:22 — forked from michaelneu/Dockerfile
docker-compose configuration for PHP with NGINX and MySQL, including sendmail, MailDev and phpmyadmin
# see https://github.com/cmaessen/docker-php-sendmail for more information
FROM php:7.2.8-fpm
RUN apt-get update && apt-get install -q -y ssmtp mailutils && rm -rf /var/lib/apt/lists/*
RUN docker-php-ext-install mysqli sysvsem
RUN pecl install xdebug-2.5.5 \
&& echo "zend_extension=$(find /usr/local/lib/php/extensions/ -name xdebug.so)" > /usr/local/etc/php/conf.d/xdebug.ini \
@remynguyen96
remynguyen96 / Git-Command.md
Last active April 1, 2020 16:25
A list of commonly used Git commands

Git Commands

A list of commonly used Git commands

--

Getting & Creating Projects

| Command | Description |

@remynguyen96
remynguyen96 / Sort-Algorithms.js
Last active May 3, 2020 06:31
Some basic sort algorithms.
function initRandomArray(n) {
const arr = [];
for (let i = 0; i < n; i++) {
const number = Math.floor(Math.random() * (100 - 1) + 1);
arr.push(number);
}
return arr;
}
@remynguyen96
remynguyen96 / recursion.js
Created May 14, 2020 01:30
Basic implement recursion.
function TailRecursionGCD(m, n) {
let r;
if (m < n) return TailRecursionGCD(n, m);
console.log('Stack', m, n);
r = m % n;
if (r === 0) {
console.log(`R ---- m ---- ${m}, n ----- ${n}`);
@remynguyen96
remynguyen96 / cloudSettings
Last active March 16, 2021 12:24
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-29T00:15:29.344Z","extensionVersion":"v3.4.3"}
@remynguyen96
remynguyen96 / .tmux.config
Created November 12, 2020 15:06
Tmux configuration. (~/.tmux.conf)
# C-b is not acceptable -- Vim uses it
set -g prefix C-a
bind C-a send-prefix
unbind C-b
# Quick reload
bind r source-file ~/.tmux.conf
# True colors mode
# Add truecolor support
@remynguyen96
remynguyen96 / .zshrc
Created November 12, 2020 15:08
Zshrc configuration (~/.zshrc)
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH="/Users/P800180/.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
@remynguyen96
remynguyen96 / .init.vim
Created November 12, 2020 15:10
Initial neovim (~/.config/nvim/init.vim)
source $HOME/.config/nvim/vim-plug/plugins.vim
" Leader
let mapleader = " "
source $HOME/.config/nvim/theme.vim
source $HOME/.config/nvim/nerdtree_fzf.vim
source $HOME/.config/nvim/coc.vim
" Copy to clipboard
@remynguyen96
remynguyen96 / nerdtree_fzf.vim
Last active November 12, 2020 15:14
Nerdtree configuration (~/.config/nvim/nerdtree_fzf.vim)
" NERD tree configuration
inoremap jk <ESC>
noremap <C-d> :NERDTreeToggle<CR>
nnoremap F :NERDTreeFind<CR>
nnoremap <S-h> :tabprevious<CR>
nnoremap <S-l> :tabnext<CR>
nnoremap <S-t> :tabnew<CR>
" press s key for opening to the right, i for opening to the bottom, enter for opening it in the current split
let g:NERDTreeWinSize=35