Skip to content

Instantly share code, notes, and snippets.

View katoy's full-sized avatar

revers katoy

  • japan/tokyo
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Leaflet Quick Start Guide Example</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.5/leaflet.css" />
<!--[if lte IE 8]>
@katoy
katoy / client.coffee
Last active December 15, 2015 16:59
Sample for pillion ( https://github.com/deoxxa/pillion )
et = require 'net'
burro = require 'burro'
pillion = require 'pillion'
port = 3000
socket = burro.wrap(net.connect(port))
rpc = new pillion(socket)
rpc.callRemote "greet"
@katoy
katoy / app.js
Last active December 15, 2015 04:20
simple calc using pegjs.
//
// arithmetics.js の生成方法
//========================
// $ npm nstall pegjs -g
// $ pegjs -e arithmetics arithmetics.pegjs
//
$(function() {
$("#inp_text").keypress(function(ev) {
@katoy
katoy / client-async.coffee
Last active December 14, 2015 09:29
Sample for dnode ans async.
async = require("async")
dnode = require("dnode")
util = require("util")
port = 7070
remote = null
conn = null
tasks = []
tasks.push (callback) ->
@katoy
katoy / express_and_lactate.coffee
Created January 26, 2013 07:57
Samples using lactate.
actate = require 'lactate'
express = require 'express'
root_dir = __dirname
port = 8080
options = debug: true
app = express()
app.use lactate.static(root_dir)
@katoy
katoy / data.txt
Created January 16, 2013 09:32
sample using domain API.
これはテストデータです。
@katoy
katoy / unzip.coffee
Last active December 10, 2015 22:58
unzip command using node.js. It works on windows and Mac.
# ファイル解凍するコマンドラインアプリケーション。
unzip = require 'unzip'
fs = require 'fs'
fstream = require 'fstream'
mkdirp = require 'mkdirp'
usage = 'usage: $ coffee unzip.coffee zipfile [out_dir]'
file = null
@katoy
katoy / icons.png
Last active December 10, 2015 01:48
Sample for ImageMagick.
icons.png
@katoy
katoy / client.coffee
Last active October 13, 2015 11:28
sample remote_process.exec and synchronize.
dnode = require 'dnode'
sync = require 'synchronize'
# コマンドをリモートで実行する
dnode.connect 5050, (remote, conn) ->
# 非同期で 5 つのコマンドを実行する
remote.zing '/bin/sh -c \"date \'+TIME: %H:%M:%S\'\"', (err, stdout, stderr) ->
console.log "err: #{err}" if err
console.log "stdout:[\n#{stdout}]" if stdout
@katoy
katoy / Book1.xlsx
Created October 7, 2012 04:11
prototype for xlsx -> html using apache poi