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
# See http://refm.rubicle.net/sp/1.9.3/class/Open3 | |
require 'open3' | |
puts "====== system ======" | |
ret = system('ps > /tmp/1') | |
puts ret | |
puts File.read('/tmp/1') | |
puts "====== Open3.capture3 ======" |
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
# -*- coding: utf-8 -*- | |
require 'erb' | |
require 'time' | |
def make_body(template, name, time, params) | |
erb = ERB.new(template) | |
result = erb.result(binding) | |
end |
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
require 'rubygems' | |
require 'net/scp' | |
host = "xxxxxxx.ne.jp" | |
user = "youichikato" | |
src_path = "/tmp/1" | |
dest_path = "/tmp/2" | |
opts = {:password => "xxxxxxxx"} | |
Net::SCP.start(host, user, opts){|scp| |
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
<!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]> |
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
et = require 'net' | |
burro = require 'burro' | |
pillion = require 'pillion' | |
port = 3000 | |
socket = burro.wrap(net.connect(port)) | |
rpc = new pillion(socket) | |
rpc.callRemote "greet" |
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
// | |
// arithmetics.js の生成方法 | |
//======================== | |
// $ npm nstall pegjs -g | |
// $ pegjs -e arithmetics arithmetics.pegjs | |
// | |
$(function() { | |
$("#inp_text").keypress(function(ev) { |
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
async = require("async") | |
dnode = require("dnode") | |
util = require("util") | |
port = 7070 | |
remote = null | |
conn = null | |
tasks = [] | |
tasks.push (callback) -> |
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
actate = require 'lactate' | |
express = require 'express' | |
root_dir = __dirname | |
port = 8080 | |
options = debug: true | |
app = express() | |
app.use lactate.static(root_dir) |
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
これはテストデータです。 |
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
# ファイル解凍するコマンドラインアプリケーション。 | |
unzip = require 'unzip' | |
fs = require 'fs' | |
fstream = require 'fstream' | |
mkdirp = require 'mkdirp' | |
usage = 'usage: $ coffee unzip.coffee zipfile [out_dir]' | |
file = null |