Skip to content

Instantly share code, notes, and snippets.

@startuml
会社 "1" o-- "many" 商談進捗
商談進捗 "1" o-- "many" アプリ
アプリ "1" o-- "many" 受注管理
アプリ "1" o-- "1" グロース
アプリ "1" o-- "many" repro
@enduml
@startuml
アプリ "1" o-- "1" 商談進捗
アプリ "1" o-- "many" 受注管理
アプリ "1" o-- "1" グロース
アプリ "1" o-- "many" repro
@enduml
@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];
@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: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) ;
}
> A = function(){}
function (){}
// prototype.constructor にはコンストラクタ自身が入っている
> A.prototype.constructor === A
true
// けど、 A.prototype.constructor を書き換えても、、
> A.prototype.constructor = function(){console.log(1)}
function (){console.log(1)}
// A には影響がない
> A.prototype.constructor === A
@mhayashi
mhayashi / app.js
Created December 26, 2010 07:42
Fix path
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@mhayashi
mhayashi / app.js
Created December 26, 2010 07:37
Fix express app's test
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@mhayashi
mhayashi / app.js
Created December 26, 2010 06:46
Fix view's path
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@mhayashi
mhayashi / app.test.js
Created December 26, 2010 06:38
Fix express's test code
// Run $ expresso
/**
* Module dependencies.
*/
var assert = require('assert');
var app = require('app');