Skip to content

Instantly share code, notes, and snippets.

var Klass = function(text){ this.text = text; };
Klass.prototype.method1 = function(){ return this.text + 'のメソッド' };
var descriptor = Object.getOwnPropertyDescriptor(Klass.prototype, 'method1')
, originalFunction = descriptor.value;
descriptor.value = function(){ console.warn('method1 is deprecated'); return originalFunction.apply(this); };
Object.defineProperty(Klass.prototype, 'method1', descriptor);
console.log(new Klass('メソッド1').method1());
@adamay000
adamay000 / nginx.conf
Last active August 29, 2015 14:26
Simple node server for test
events {
worker_connections 1024;
}
http {
# ロードバランサ
# 交互に中継する
upstream lb {
server localhost:8081;
server localhost:8082;
}
@adamay000
adamay000 / 1to100v1.js
Last active August 29, 2015 14:25
1から100まで
setTimeout((function(cnt){
console.log(cnt.length),
(cnt.length > new Number('99') ||
arguments.callee((cnt.push(''), cnt)))
).bind(this, ['']))