Skip to content

Instantly share code, notes, and snippets.

View revskill10's full-sized avatar
🎯
Focusing

Truong Hoang Dung revskill10

🎯
Focusing
  • Freelancer
  • Haiphong, Vietnam
View GitHub Profile
require 'rubygems'
require 'sinatra'
require 'fileutils'
# upload with:
# curl -v -F "data=@/path/to/filename" http://localhost:4567/user/filename
post '/:name/:filename' do
userdir = File.join("files", params[:name])
{
"name": "my-app",
"version": "0.0.0",
"dependencies": {
"browserify": "~2.36.1",
"less": "~1.5.1"
},
"devDependencies": {
"watchify": "~0.4.1",
"catw": "~0.2.0"
#import <Foundation/Foundation.h>
#import "RCTBridgeModule.h"
#define RCT_EXTERN_MODULE(objc_name, objc_supername) \
RCT_EXTERN_REMAP_MODULE(objc_name, objc_name, objc_supername)
#define RCT_EXTERN_REMAP_MODULE(js_name, objc_name, objc_supername) \
objc_name : objc_supername \
@end \
@interface objc_name (RCTExternModule) <RCTBridgeModule> \
@revskill10
revskill10 / introrx.md
Last active August 29, 2015 14:22 — forked from staltz/introrx.md

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.

var webpack = require('webpack');
var path = require("path");
module.exports = {
entry: {
app: './src/app/app.ts',
vendor: [
"jquery",
"jquery-mockjax",

Bacon.js

JavaScript のための小さな FRP (Functional Reactive Programming) ライブラリです。

手続き型から関数型に切り替えることで、イベントスパゲッティのコードがクリーンで宣言スタイルの「風水の bacon」(feng shui bacon)に変わります。入れ子のループを mapfilter のような関数型プログラミングのコンセプトに置き換えることに似ています。個別のイベントに取り組むことを止め、イベントストリームを扱います。mapfilter でデータを変換します。mergecombine でデータを combine します。重火器に切り替え、上司のように flatMapcombineTemplate を掌握します。

このライブラリはイベントのアンダースコア( _ )です。残念なことに ~ の記号は JavaScript では認められていないからです。

資料です。

gem 'jekyll', '~> 2.0.0.alpha'
gem 'nokogiri'
gem 'redcarpet'
gem 'rouge'
#!/bin/sh
#Example for unix like systems
# NOTE: Erlang must be already installed
# Download:
wget http://www.rabbitmq.com/releases/rabbitmq-server/v1.7.2/rabbitmq-server-generic-unix-1.7.2.tar.gz
# Untar:
tar -xzvf rabbitmq-server-generic-unix-1.7.2.tar.gz