Skip to content

Instantly share code, notes, and snippets.

View lynhan318's full-sized avatar

Nhân(Kevin) Lý lynhan318

View GitHub Profile
alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
@lynhan318
lynhan318 / node_nginx_ssl.md
Created August 10, 2021 11:26 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@lynhan318
lynhan318 / kMinMax.py
Last active April 1, 2020 15:46
get K Min-Max
def swap(arr,i,j):
arr[i]=arr[i]+arr[j]
arr[j]=arr[i]-arr[j]
arr[i]=arr[i]-arr[j]
def heap(a,index):
if index==len(a)-1:
return a
s=a[:len(a)-index]
length = (len(s)-2)/2
@lynhan318
lynhan318 / hashtable.py
Last active March 15, 2020 18:41
HashTable
from LinkList import LinkList
class Word:
def __init__(self,*word):
self.eng=word[0]
self.vi=word[1]
self.type=word[2]
self.description=word[3]
def __str__(self):
return " % s | % s | % s | % s" % (self.eng, self.vi,self.type,self.description)
@lynhan318
lynhan318 / linkedlist.py
Created February 6, 2020 16:12
[DataStructure] Linked List
class Node:
def __init__(self, defaultValue=None):
self.value = defaultValue
self.next = None
self.prev = None
class LinkList:
def __init__(self):
self.head = None
self.tail = None
FROM node:8.12.0 AS app-builder
WORKDIR /root/app
RUN git clone https://github.com/1412369/onsolve
WORKDIR /root/app/onsolve
RUN yarn
RUN yarn build
FROM node:8.12.0 AS lib-builder
WORKDIR /root/app/onsolve
COPY --from=app-builder /root/app/onsolve .