This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 0679d20b600ffabbb8341eab6cae733696e6ff06 Mon Sep 17 00:00:00 2001 | |
From: Yuichiro MASUI <[email protected]> | |
Date: Sat, 13 Feb 2010 03:27:01 -0800 | |
Subject: [PATCH] Fixed: promise late chain | |
--- | |
src/node.js | 2 +- | |
test/mjsunit/test-promise.js | 12 ++++++------ | |
2 files changed, 7 insertions(+), 7 deletions(-) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'); | |
var Parent = function(n) { | |
this.n = n; | |
} | |
Parent.prototype.display1 = function() { | |
sys.puts("display1:"+this.n); | |
} | |
Parent.prototype.display2 = function() { | |
sys.puts("display2:"+this.n); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// sweeper.php - public domain | |
// まずは試しに ..../sweeper.php?debug=1で実行してください | |
$sweep_dir = "/tmp/data/"; // 消したいディレクトリ ex) "/tmp/data/" 最後の/は必須です | |
$expire_at = 30; // ファイルを保存する日数を設定します | |
$debug = array_key_exists('debug', $_GET); | |
date_default_timezone_set('Asia/Tokyo'); | |
$num = sweep_files($sweep_dir, $expire_at ,$debug); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'datamapper' | |
require "google_spreadsheet" # http://github.com/gimite/google-spreadsheet-ruby | |
GOOGLE_SPREADSHEET = ['[email protected]', 'password', 'SPREADSHEET KEY'] | |
DataMapper.setup(:default, "sqlite3://#{Dir.pwd}/sample.sqlite3") | |
class Item | |
include DataMapper::Resource |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1行でロボットによるスパム対策するコード | |
* ライブドアのスパムちゃんぷるーDNSBL(β)を使っています | |
* http://spam-champuru.livedoor.com/dnsbl/ */ | |
if(strtoupper(getenv('REQUEST_METHOD'))=='POST'&&checkdnsrr(implode('.', array_reverse(explode('.',getenv('REMOTE_ADDR')))).".dnsbl.spam-champuru.livedoor.com","A"))exit; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Socket.prototype.process_tcp_read_queue = function() { | |
if(this.read_queue.length==0) return; | |
var task, data; | |
if(typeof(this.read_queue[0].len)=='undefined') { | |
task = this.read_queue.shift(); | |
data = this.buffer; | |
this.buffer = ''; | |
require("sys").puts(' ["server", "'+data.split('').map(function(s){return ((s.charCodeAt(0)<16?"0":'')+s.charCodeAt(0).toString(16)).substring();}).join(' ')+'"],'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
# gem 'mysql' | |
# or | |
gem 'ruby-mysql' | |
require 'mysql' | |
conn = Mysql.connect('localhost','nodejs_mysql', 'nodejs_mysql', 'nodejs_mysql') | |
COUNT = 100000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0"?> | |
<package xmlns="http://www.idpf.org/2007/opf" unique-identifier="BookID" version="2.0"> | |
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf"> | |
<dc:title>samp001</dc:title> | |
<dc:creator opf:role="aut">sample</dc:creator> | |
<dc:language>ja</dc:language> | |
<dc:identifier id="BookID" opf:scheme="URL">http://example.com/epub/sample/sample1.epub</dc:identifier> | |
</metadata> | |
<manifest> | |
<item id="ncx" href="toc.ncx" media-type="application/x-dtbncx+xml"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
require 'cgi' | |
require 'open-uri' | |
require 'rubygems' | |
require 'zipruby' | |
require 'rmagick' | |
SUPPORT_FORMAT = /\.(png|jpg)$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Titanium mobile Rakefile for iPhone build | |
# | |
DEV_PROVISIONING_UUID = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX" | |
DEV_SIGN = "Developer name" | |
DEV_APP_NAME = "DevApp" | |
DEV_APP_ID = 'com.example.dev' | |
TITANIUM_SDK_VERSION = '1.3.2' |