Skip to content

Instantly share code, notes, and snippets.

View sdhjl2000's full-sized avatar
🎯
Focusing

jason hu sdhjl2000

🎯
Focusing
View GitHub Profile
#!/bin/sh
#
# /etc/rc.d/init.d/supervisord
#
# Supervisor is a client/server system that
# allows its users to monitor and control a
# number of processes on UNIX-like operating
# systems.
#
# chkconfig: - 64 36
@sdhjl2000
sdhjl2000 / gist:059f649b2c34bacf8ebf
Created May 31, 2015 14:57
return first done or wait all
package main
import "fmt"
import (
"time"
)
//import "math/rand"
func main() {
@sdhjl2000
sdhjl2000 / cmd.sh
Last active August 29, 2015 14:19 — forked from kelvinn/cmd.sh
# post_loc.txt contains the json you want to post
# -p means to POST it
# -H adds an Auth header (could be Basic or Token)
# -T sets the Content-Type
# -c is concurrent clients
# -n is the number of requests to run in the test
ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called (Functional) Reactive Programming (FRP).

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.

@sdhjl2000
sdhjl2000 / douban
Created December 30, 2012 09:59
douban reder
#encoding: utf-8
#author:t-y
#http://pythoner.net
import time,math,os,re,urllib,urllib2,cookielib
class douban_robot:
email = '[email protected]'
password = 'sdhjl200'
login_path = 'https://www.douban.com/accounts/login'
@sdhjl2000
sdhjl2000 / gist:4256533
Created December 11, 2012 07:17
NHtmlUnit
using System;
using System.Linq;
using NHtmlUnit;
using NHtmlUnit.Html;
using NUnit.Framework;
using HtmlAgilityPack;
@sdhjl2000
sdhjl2000 / gist:4223018
Created December 6, 2012 08:59
rashelper
using System;
using System.Linq;
using APSP.Form.Model;
using NHibernateRepository;
using NUnit.Framework;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
namespace APSPTest
@sdhjl2000
sdhjl2000 / gist:3949945
Created October 25, 2012 01:21
generate html
# coding=gbk
from pygments import highlight
from pygments.lexers import PythonLexer,CSharpLexer
from pygments.formatters import HtmlFormatter
from pygments.lexers import get_lexer_by_name
import os