Skip to content

Instantly share code, notes, and snippets.

View yshnb's full-sized avatar

Yoshinobu Wakamatsu yshnb

  • Funds, Inc.
  • Tokyo, Japan
  • X @yshnb
View GitHub Profile
@yshnb
yshnb / Option.js
Created June 19, 2015 16:27
Option Monad in JavaScript
/**
* Option Monad in JavaScript
*/
function Option() {
}
function Some(value) {
this.value = value;
}
# encoding: UTF-8
require 'optparse'
require 'net/http'
require 'json'
def parse_options(argv)
opts = {}
@parser = OptionParser.new do |o|
@yshnb
yshnb / .kitchen.yml
Last active August 29, 2015 14:00
test-kitchen + serverspecで行うchef-repoのテスト ref: http://qiita.com/yshnb/items/854a1770d0d47479ab47
driver:
name: vagrant
provisioner:
name: chef_solo
platforms:
# - name: ubuntu-12.04
- name: centos-64
// repeat input text
var repeat = function(text, times) {
return (new Array(times+1)).join(text);
};
// example
console.log(repeat("Hello, world!", 10));
//Hello, world!Hello, world!Hello, world!Hello, world!Hello, world!Hello, world!Hello, world!Hello, world!Hello, world!Hello, world!
@yshnb
yshnb / fabfile.py
Created April 3, 2013 18:10
fabfile to setup ssh-key in remote-server
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os,sys,time
import fabric
from fabric.contrib.files import *
from fabric.api import *
from fabric.operations import *
import ilogue.fexpect