Skip to content

Instantly share code, notes, and snippets.

Avatar
🇻🇳

Oanh Nguyen oanhnn

🇻🇳
View GitHub Profile
@oanhnn
oanhnn / js.code-workplace
Last active Aug 27, 2019
VSCode settings
View js.code-workplace
{
"folders": [
{
"path": "..."
}
],
"settings": {
"emmet.includeLanguages": {
"javascript": "html",
"vue": "html",
View use-reduce.js
const callbackFunction1 = function(
accumulator,
currentElement,
currentIndex,
array
) {
// Get the maximum by checking first if there is a maximum from the previous step
const maximum = accumulator.maximum
? // If there is, then check if the current element is higher than the previous maximum
@oanhnn
oanhnn / amazon-linux2-user-data.sh
Last active Mar 27, 2019
LEMP provider scripts
View amazon-linux2-user-data.sh
#!/bin/bash -ex
GITLABUSER=oanhnn
SSHUSER=oanhnn
addgroup dev
adduser --disabled-password --ingroup dev $SSHUSER
usermod -aG sudo $SSHUSER
mkdir -p /home/$SSHUSER/.ssh
@oanhnn
oanhnn / input-range.scss
Created May 17, 2018
Styling Cross-Browser Compatible Range Inputs with Sass
View input-range.scss
// Styling Cross-Browser Compatible Range Inputs with Sass
// Github: https://github.com/darlanrod/input-range-sass
// Author: Darlan Rod https://github.com/darlanrod
// Version 1.4.1
// MIT License
$track-color: #eceff1 !default;
$thumb-color: #607d8b !default;
$thumb-radius: 12px !default;
@oanhnn
oanhnn / install-redis.sh
Created May 9, 2018 — forked from khelll/install-redis.sh
Installing Redis on Amazon Linux
View install-redis.sh
#!/bin/bash
###############################################
# To use:
# chmod +x install-redis.sh
# ./install-redis.sh
###############################################
version=3.2.0
echo "*****************************************"
echo " 1. Prerequisites: Install updates, set time zones, install GCC and make"
@oanhnn
oanhnn / install_wkhtmltopdf.sh
Created May 3, 2018
Install wkhtmltopdf on AMZ Linux
View install_wkhtmltopdf.sh
#!/usr/bin/env bash
VERSION=${1:-0.12.4}
yum -y install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo openssl icu
wget https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/${VERSION}/wkhtmltox-${VERSION}_linux-generic-amd64.tar.xz --dns-timeout=5 --connect-timeout=5
tar -xJf wkhtmltox-${VERSION}_linux-generic-amd64.tar.xz
cp wkhtmltox/bin/wkhtmltopdf /usr/local/bin/wkhtmltopdf
cp wkhtmltox/bin/wkhtmltoimage /usr/local/bin/wkhtmltoimage
@oanhnn
oanhnn / remove-vhost.sh
Last active Nov 21, 2020
[Ubuntu 16.04] Setup server using NGINX proxy multi site with SSL (Certbot)
View remove-vhost.sh
#!/usr/bin/env bash
DOMAIN=${1:-example.local}
APP_SLUG=${2:-example}
service nginx stop
rm -rf /etc/nginx/sites-available/10-${APP_SLUG}.conf /etc/nginx/sites-enabled/10-${APP_SLUG}
echo "[✔] Remove Virtual Host for ${DOMAIN}"
@oanhnn
oanhnn / laravel-queue.service
Last active May 30, 2019 — forked from thomasjsn/laravel-queue.service
Laravel queue worker using systemd.
View laravel-queue.service
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@oanhnn
oanhnn / README.md
Last active Sep 23, 2017
Deploy laravel to shared host
View README.md

Phương pháp triển khai ứng dụng Laravel trên shared hosting

Hướng dẫn đơn giản để triển khai ứng dụng Laravel và Lumen trên shared hosting.

Yêu cầu

Before trying to deploy a Laravel application on a shared hosting, you need to make sure that the hosting services provide a fit requirement to Laravel. Basically, following items are required for Laravel 5.2: Trước khi thực hiện triển khai ứng dụng Laravel trên shared hosting, bạn cần đảm bảo nhà cung cấp dịch vụ cho bạn môi trường với các yêu cầu cần thiết cho Laravel. Về cơ bản, yêu cầu cho Laravel 5.2 như sau:

  • PHP >= 5.5.9
@oanhnn
oanhnn / bash-cheatsheet.sh
Created May 31, 2017 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems
View bash-cheatsheet.sh
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
You can’t perform that action at this time.