Skip to content

Instantly share code, notes, and snippets.

View kintone-improvement.puml
@startuml
会社 "1" o-- "many" 商談進捗
商談進捗 "1" o-- "many" アプリ
アプリ "1" o-- "many" 受注管理
アプリ "1" o-- "1" グロース
アプリ "1" o-- "many" repro
@enduml
View 0722.puml
@startuml
アプリ "1" o-- "1" 商談進捗
アプリ "1" o-- "many" 受注管理
アプリ "1" o-- "1" グロース
アプリ "1" o-- "many" repro
@enduml
@mhayashi
mhayashi / gist:f23152624e89f495438e
Last active Aug 29, 2015
JSON to NSDictionary
View gist:f23152624e89f495438e
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 Mar 10, 2011
get github issues with node
View issues.js
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 Feb 5, 2011
if vs. assert vs. should
View gist:812191
var assert = require('assert');
var should = require('should');
var a = 1;
var times = 1000000;
console.time('if ');
while(times--) {
if (a === 1) ;
}
View modify_constructor.js
> 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
View app.js
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@mhayashi
mhayashi / app.js
Created Dec 26, 2010
Fix express app's test
View app.js
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@mhayashi
mhayashi / app.js
Created Dec 26, 2010
Fix view's path
View app.js
/**
* Module dependencies.
*/
var express = require('express');
var app = module.exports = express.createServer();
// Configuration
@mhayashi
mhayashi / app.test.js
Created Dec 26, 2010
Fix express's test code
View app.test.js
// Run $ expresso
/**
* Module dependencies.
*/
var assert = require('assert');
var app = require('app');