Skip to content

Instantly share code, notes, and snippets.

View EcutDavid's full-sized avatar
📚

David Guan EcutDavid

📚
View GitHub Profile

Reverse proxy

A reverse proxy is a type of proxy server that retrieves resources on behalf of a client from one or more servers. These resources are then returned to the client as though they originated from the proxy server itself.[1] While a forward proxy acts as an intermediary for its associated clients to contact any server, a reverse proxy acts as an intermediary for its associated servers to be contacted by any client.

  • Getting Things Done. The Art of Stress-Free Productivity
@EcutDavid
EcutDavid / environment
Created June 11, 2016 03:27
Node application depoly
sudo apt-get update
sudo apt-get install nodejs
sudo apt-get install npm
cd ~
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh
sudo bash nodesource_setup.sh
sudo apt-get install nodejs
sudo apt-get install build-essential
Java version control: https://github.com/gcuisinier/jenv
Blueocean plugin reference: https://github.com/cloudbees/blueocean-sample-pipeline-result-ext-plugin
First, start with Jenkins plugin tutorial: https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial
Then, check out: https://github.com/jenkinsci/blueocean-plugin
@EcutDavid
EcutDavid / typescriptDemo.ts
Last active August 27, 2017 06:01
Flappy bird
const optionsInPlainJS = [{
// Oooops
local: 'EN',
index: 1
}, {
locale: 'JP',
index: 2
}, {
locale: 'CH',
index: 3
const canvasWidthHeight = 512;
const BIRD_FRAME_LIST = [
'./images/frame-1.png',
'./images/frame-2.png',
'./images/frame-3.png',
'./images/frame-4.png',
];
class Bird {
private sprite = new PIXI.Sprite();
class Tube {
private x: number;
private y: number;
private innerDistance = 80;
private tubeWidth = 20;
private sprite = new PIXI.Graphics();
reset(x: number = canvasWidthHeight + 20) {
this.x = x;
class Particle {
private posX: number;
private posY: number;
private speedX = 0;
private speedY = 0;
private sprite: PIXI.Sprite;
private container: PIXI.Container;
constructor(container: PIXI.Container, baseTexture: PIXI.BaseTexture, posX: number, posY: number) {
this.sprite = new PIXI.Sprite(new PIXI.Texture(baseTexture));
insertSort :: (Ord a) => [a] -> [a]
insertSort [] = []
insertSort (firEle:arrLeft) = insert firEle (insertSort arrLeft)
where insert a [] = [a]
insert a (b:c)
| a < b = a : b : c
| otherwise = b : insert a c
bubbleSort :: (Ord a) => [a] -> [a]
bubbleSort [] = []
bubbleSort [x] = [x]
bubbleSort (x:y:arrLeft) = bubbleSort(init bubbled) ++ [last bubbled]
where (smaller,bigger) = if(x <= y) then (x, y) else (y, x)
bubbled = [smaller] ++ bubbleSort (bigger:arrLeft)