- $ ./gyp_uv.py -f xcode
- make project from the generated xcodeproj
reference: libuv/libuv#137
| var cluster = require('cluster'); | |
| if (cluster.isMaster) { | |
| for (var i = 0; i < 4; ++i) { | |
| cluster.fork(); | |
| } | |
| } else { | |
| console.log(process.pid, cluster.worker.id); | |
| } |
| /* package.json | |
| { | |
| "name": "photo", | |
| "version": "0.0.0", | |
| "description": "ERROR: No README.md file found!", | |
| "main": "index.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "dependencies": {"shelljs":"*", "underscore.string": "*"}, |
| { | |
| "reset":true, | |
| "cursor":"AAHskXVmJSRVG_bgh4Oq2VPQqG79nWM26Tl8jSmRyiGM3M0EGLzi_df861bAJ6q5xzkbQD7WhMTh8cEA2s1GUlDg79gRBPQJ6D5vJvah2sZrBg", | |
| "has_more":false, | |
| "entries":[ | |
| ["/proj1",{"revision":3,"rev":"30ec9923d","thumb_exists":false,"bytes":0,"modified":"Wed, 20 Mar 2013 05:58:43 +0000","path":"/proj1","is_dir":true,"icon":"folder_app","root":"app_folder","size":"0 bytes"}], | |
| ["/proj1/current",{"revision":6,"rev":"60ec9923d","thumb_exists":false,"bytes":0,"modified":"Wed, 20 Mar 2013 05:58:48 +0000","path":"/proj1/current","is_dir":true,"icon":"folder_app","root":"app_folder","size":"0 bytes"}], | |
| ["/proj1/backup",{"revision":9,"rev":"90ec9923d","thumb_exists":false,"bytes":0,"modified":"Wed, 20 Mar 2013 05:58:59 +0000","path":"/proj1/backup","is_dir":true,"icon":"folder_app","root":"app_folder","size":"0 bytes"}], | |
| ["/proj1/current/test.txt",{"revision":12,"rev":"c0ec9923d","thumb_exists":false,"bytes":34,"modified":"Wed, 20 Mar 2013 06:10:51 +0000","client_mtime":"Wed, 20 Mar 2013 06:10:4 |
| brew install the-silver-searcher | |
| brew install tree | |
| brew install curl | |
| brew install wget | |
| brew install tmux | |
| brew install zsh | |
| brew install zsh-completions | |
| brew install git | |
| brew install boot2docker |
| var ts = require('tail-stream'); | |
| require('http').createServer(function (req, res) { | |
| res.writeHead(200, { | |
| 'Content-Type': 'text/plain' | |
| }); | |
| var stream = ts.createReadStream(req.url.substr(1), { | |
| detectTruncate: true, | |
| onTruncate: 'end', | |
| endOnError: false | |
| }); |
| using UnityEngine; | |
| using System.Collections; | |
| public class Coro1 : MonoBehaviour { | |
| IEnumerator Task() { | |
| while (true) { | |
| Debug.Log("Coro1"); | |
| yield return new WaitForSeconds(1); | |
| } |
| protected delegate void OnResponse(string error, string body); | |
| protected void Post(string url, Dictionary<string, string> options, OnResponse onResponse) | |
| { | |
| StartCoroutine(PostFlow(url, options, onResponse)); | |
| } | |
| protected IEnumerator PostFlow(string url, Dictionary<string, string> options, OnResponse onResponse) | |
| { | |
| if (options == null) | |
| { |
| var Markdown = require('markdown').markdown.Markdown; | |
| var MyDialect = Markdown.subclassDialect(Markdown.dialects.Gruber); | |
| MyDialect.inline['{'] = function inline_ruby(text, matches, out) { | |
| var m = text.match(/^\{(.+)\|(.+)\}/); | |
| if (m) { | |
| return [m[0].length, ['ruby', m[2], m[1]]]; | |
| } else { | |
| // no match | |
| return [1, '{']; | |
| } |
| template <typename Fn> | |
| void set_timeout(Fn fn, uint64_t timeout, uv_loop_t* l = nullptr) { | |
| struct payload { | |
| uv_timer_t timer; | |
| Fn fn; | |
| payload(Fn&& f) : fn(f) {} | |
| }; | |
| payload* p = new payload(std::move(fn)); | |
| if (!l) { |
reference: libuv/libuv#137