Skip to content

Instantly share code, notes, and snippets.

View shokai's full-sized avatar

Sho Hashimoto shokai

View GitHub Profile
@shokai
shokai / Gemfile
Created May 27, 2014 06:11
slackのchatにrubyから投稿
source "https://rubygems.org"
gem "slackbot"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
trait EventEmitter{
val List = scala.collection.immutable.List
var eid = 0
class Event(_id:Int, _name:String, _callback:(Any) => Unit, _once:Boolean){
var name = _name
var callback = _callback
val id = _id
var once = _once
@shokai
shokai / bleacon-advertise.coffee
Last active August 29, 2015 14:01
bleaconが起動失敗したり成功したりする。それぞれ15行目はUUIDのconsole.logで出力された行。DEBUG=* coffee bleacon-advertise.coffee `uuidgen` で起動
## ビーコン発信側
Bleacon = require 'bleacon'
uuid = process.argv[2] || "805D6740-F575-492A-8668-45E553EB9DF2"
major = 1
minor = 1
console.log uuid
@shokai
shokai / .gitignore
Last active August 29, 2015 14:01
iBeacon on Node.js
*~
*#*
.DS_Store
node_modules
*.log
tmp
#!/usr/bin/env ruby
puts "👀\n👃\n👄 < #{ ARGV.empty? ? ARGF.read : ARGV.join(' ') }"
## webページ内の単語をカウントする
require 'httparty'
require 'nokogiri'
require 'natto'
if ARGV.empty?
STDERR.puts "e.g. ruby #{$0} http://shokai.org/blog/"
exit 1
end
#!/usr/bin/env ruby
puts "👀\n👃\n👄 < #{ ARGV.empty? ? ARGF.read : ARGV.join(' ') }"
@shokai
shokai / keynote.rb
Created May 9, 2014 00:40
Apple KeyNote09's slide format parser
require 'archive/zip'
require 'htmlentities'
require 'nokogiri'
class Keynote
attr_reader :document, :pages
def initialize(filename)
@filename = filename
@shokai
shokai / README.md
Last active August 29, 2015 13:56
global keyhook with JRuby