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 / 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 / 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 / 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 / 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 / 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) {