Skip to content

Instantly share code, notes, and snippets.

View jihchi's full-sized avatar
🦀

Jihchi Lee jihchi

🦀
View GitHub Profile
@jihchi
jihchi / install.sh
Last active May 27, 2016 14:37
Docker Engine Installation Script for Ubuntu 14.04 (LTS)
#!/bin/bash
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo touch /etc/apt/sources.list.d/docker.list
sudo sh -c 'echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list'
sudo apt-get update
sudo apt-get install -y docker-engine
sudo service docker start
sudo usermod -aG docker $(whoami)

Getting Started

git clone https://gist.github.com/841ccaccb8efcdafa3b7.git playground
cd playground
npm install
npm start

Then point your browser at http://localhost:3000

@jihchi
jihchi / install_bash-It_default.sh
Last active September 5, 2015 03:56
My Bash It Default Installation
#!/bin/bash
# bash-it
BASH_IT=~/.bash_it
if [ ! -d "$BASH_IT" ]; then
git clone --depth=1 https://github.com/Bash-it/bash-it.git $BASH_IT
$BASH_IT/install.sh
fi
source ~/.bashrc
FROM <private repo>
MAINTAINER Ross Kukulinski "ross@speakit.io"
ADD nginx.toml /etc/confd/conf.d/nginx.toml
ADD templates/nginx.tmpl /etc/confd/templates/nginx.tmpl
ADD confd-watch /usr/local/bin/confd-watch
RUN chmod +x /usr/local/bin/confd-watch
@jihchi
jihchi / introrx.md
Created April 16, 2015 01:36 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing in Traditional Chinese language

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@jihchi
jihchi / nginx.conf
Last active August 29, 2015 14:13 — forked from dctrwatson/nginx.conf
user www-data;
worker_processes 4;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
@jihchi
jihchi / echoHttpRequest.js
Last active August 29, 2015 14:13 — forked from Marak/echoHttpRequest.js
Echo HTTP requests
module['exports'] = function echoHttp (hook) {
hook.debug("Debug messages are sent to the debug console");
hook.debug(hook.params);
hook.debug(hook.req.path);
hook.debug(hook.req.method);
var WithOutlets = {
componentWillMount: function() {
this.setOutlets(this.props);
},
componentWillUpdate: function(nextProps) {
if(!nextProps || this.props.children !== nextProps.children) {
this.setOutlets(nextProps);
}
},
setOutlets: function(props) {
package main
import "fmt"
import "time"
import "sync"
//This datastructure never gets modified, only new ones created.
type Config struct {
a string
b string