Skip to content

Instantly share code, notes, and snippets.

View longngn's full-sized avatar
🎯
Focusing

Long Nguyen longngn

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am longngn on github.
  • I am vulong (https://keybase.io/vulong) on keybase.
  • I have a public key ASD2OrtmWZfrikKlCbr2fj4urEj6bxWcIVzHLOSVjqp6Lgo

To claim this, I am signing this object:

(() => {
var MD5 = function(d){result = M(V(Y(X(d),8*d.length)));return result.toLowerCase()};function M(d){for(var _,m="0123456789ABCDEF",f="",r=0;r<d.length;r++)_=d.charCodeAt(r),f+=m.charAt(_>>>4&15)+m.charAt(15&_);return f}function X(d){for(var _=Array(d.length>>2),m=0;m<_.length;m++)_[m]=0;for(m=0;m<8*d.length;m+=8)_[m>>5]|=(255&d.charCodeAt(m/8))<<m%32;return _}function V(d){for(var _="",m=0;m<32*d.length;m+=8)_+=String.fromCharCode(d[m>>5]>>>m%32&255);return _}function Y(d,_){d[_>>5]|=128<<_%32,d[14+(_+64>>>9<<4)]=_;for(var m=1732584193,f=-271733879,r=-1732584194,i=271733878,n=0;n<d.length;n+=16){var h=m,t=f,g=r,e=i;f=md5_ii(f=md5_ii(f=md5_ii(f=md5_ii(f=md5_hh(f=md5_hh(f=md5_hh(f=md5_hh(f=md5_gg(f=md5_gg(f=md5_gg(f=md5_gg(f=md5_ff(f=md5_ff(f=md5_ff(f=md5_ff(f,r=md5_ff(r,i=md5_ff(i,m=md5_ff(m,f,r,i,d[n+0],7,-680876936),f,r,d[n+1],12,-389564586),m,f,d[n+2],17,606105819),i,m,d[n+3],22,-1044525330),r=md5_ff(r,i=md5_ff(i,m=md5_ff(m,f,r,i,d[n+4],7,-176418897),f,r,d[n+5],12,1200080426),m,f,d[n+6],17,-1473231
version: '3'
services:
app:
command: npm run prod
restart: always
environment:
- NODE_ENV=production
version: '3'
services:
app:
command: npm run dev
volumes:
- .:/usr/src/your-app
environment:
- NODE_ENV=development
FROM node:8-alpine
WORKDIR /usr/src/your-app
COPY package*.json ./
RUN if [ "$NODE_ENV" = "development" ]; \
then npm install; \
else npm install --only=production; \
fi
version: '3'
services:
app:
build: .
ports:
- '${PORT}:80'
@longngn
longngn / Dockerfile
Last active September 6, 2018 15:17
Dockerfile run npm install based on environments example
RUN if [ "$NODE_ENV" = "development" ]; \
then npm install; \
else npm install --only=production; \
fi
// 1. Put this file into the folder "bits"
// 2. Put this line into "bits/stdc++.h": #include "cp-debug.cpp"
// 3. Now you can cout << STL !! Modify this code as to suit your style
// Example: https://imgur.com/a/kulaD
using namespace std;
template <class T1, class T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &a) {
return os << '(' << a.first << ", " << a.second << ')';
}
@longngn
longngn / vscode-competitive-programming.md
Created August 1, 2017 06:47
Configure VSCode for competitive programming

What is competitive programming?

Sites like CodeForces, TopCoder, HackerRank, CodeChef,... ACM-ICPC, Olympiad in Informatics (for high school students), Google Code Jam, Facebook Hacker Cup,... Anything involves solving short problems in 2-5 hours by code using algorithms and data structures.

Requirements

  • High coding speed.
  • One-click compile and run for one source file.
  • Automatic linting
@longngn
longngn / test.swift
Created January 3, 2017 15:48
test code
func square(a: Int) -> Int {
return a * a
}
func apply(modifier: (Int) -> Int, array: [Int]) {
for a in array {
a = modifier(a)
}
}
var a = [1,2,3,4]