Skip to content

Instantly share code, notes, and snippets.

@mhayashi
mhayashi / gist:812191
Created February 5, 2011 04:17
if vs. assert vs. should
var assert = require('assert');
var should = require('should');
var a = 1;
var times = 1000000;
console.time('if ');
while(times--) {
if (a === 1) ;
}
@mhayashi
mhayashi / issues.js
Created March 10, 2011 07:08
get github issues with node
var GitHubApi = require("github").GitHubApi
, user = 'joyent'
, repo = 'node'
, status = 'open'
;
var github = new GitHubApi(true);
github.getIssueApi().getList(user, repo, status, function(err, issues) {
console.log(issues.length + ' issues');
issues.sort(function(a, b) {
@mhayashi
mhayashi / gist:f23152624e89f495438e
Last active August 29, 2015 14:06
JSON to NSDictionary
NSData *jsonData = [@"{}" dataUsingEncoding:NSUTF8StringEncoding]; // --> {};
NSDictionary *result = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingAllowFragments
error:nil];
jsonData = [@"{\"a\":{}}" dataUsingEncoding:NSUTF8StringEncoding]; // --> { a = {}; }
result = [NSJSONSerialization JSONObjectWithData:jsonData
options:NSJSONReadingAllowFragments
error:nil];
@startuml
アプリ "1" o-- "1" 商談進捗
アプリ "1" o-- "many" 受注管理
アプリ "1" o-- "1" グロース
アプリ "1" o-- "many" repro
@enduml
@startuml
会社 "1" o-- "many" 商談進捗
商談進捗 "1" o-- "many" アプリ
アプリ "1" o-- "many" 受注管理
アプリ "1" o-- "1" グロース
アプリ "1" o-- "many" repro
@enduml