Skip to content

Instantly share code, notes, and snippets.

View fukayatsu's full-sized avatar
🏠
Working from home

Atsuo Fukaya fukayatsu

🏠
Working from home
View GitHub Profile
@fukayatsu
fukayatsu / s3fs-cloudpack-install-mac-lion.md
Created October 18, 2012 05:53
use s3fs-cloudpack on mac osx mountain lion

fuse4x

$ brew install fuse4x

brewの支持にしたがって以下を実行

$ sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions
$ sudo chmod +s /Library/Extensions/fuse4x.kext/Support/load_fuse4x

curl

$ cd ~/tmp

@fukayatsu
fukayatsu / jotei.coffee
Created December 2, 2012 10:19
hubot command
# Description:
# jotei
#
# Commands:
# hubot jotei img - Searches Google Images for the jotei
# hubot jotei tweet - Recent tweet of the jotei
module.exports = (robot) ->
robot.respond /jotei img/i, (msg) ->
imageMe msg, "yamashitam", (url) ->
@fukayatsu
fukayatsu / light_sensor.rb
Last active December 11, 2015 23:08
njl7502lと抵抗50Ωぐらいで室内光を測ってみたときのコード
require 'dino'
board = Dino::Board.new(Dino::TxRx.new)
sensor = Dino::Components::Sensor.new(pin: 'A0', board: board)
dataset = []
on_data = Proc.new do |data|
dataset << data.to_i
if (dataset.size >= 64)
@fukayatsu
fukayatsu / temperature_sensor.rb
Last active December 11, 2015 23:08
LM35で室温を測ってみた時のコード
require 'dino'
VCC = 5.0
VOLTS_PER_TEMP = 0.01
DATA_MAX = 1024
board = Dino::Board.new(Dino::TxRx.new)
sensor = Dino::Components::Sensor.new(pin: 'A2', board: board)
dataset = []
@fukayatsu
fukayatsu / gist:4691160
Created February 1, 2013 12:57
pryとDinoで3色LED
pry -rdino
> board = Dino::Board.new Dino::TxRx.new
> rgb_led = Dino::Components::RgbLed.new(board: board, pins: {red: 9, blue: 10, green: 11})
> rgb_led.red
> rgb_led.blue
> rgb_led.green
> [:red, :blue, :green].cycle do |color|
> rgb_led.send color
@fukayatsu
fukayatsu / ruby-highlighting.rb
Created February 25, 2013 12:09
sublime text 2のrubyのハイライトがちょっと変。`gem`の優先順位が高すぎる気がする。こういうの何処に言えばいいんだろう。
#!/usr/bin/env ruby
gem = "hello, world"
puts "#{gem}"
puts "#{gem}"
@fukayatsu
fukayatsu / mitsuworu.coffee
Created March 1, 2013 14:50
みつをる(縦書ジェネレータ) for hipchat
# Description:
# みつをる(縦書ジェネレータ) - http://mitsuwo.net/
#
# Commands:
# hubot mitsuwo [body],[author]
# hubot mitsuwo 寿司が<br>食べたいのです,名無し
request = require('request') # add `"request": "2.14.x"` to package.json
module.exports = (robot) ->
dev:
targets:
- http://www.iana.org/domains/example/foo
dev2:
label: ※画面は開発中のものです
targets:
- http://www.iana.org/domains/example/bar
ignores:
- http://www.iana.org/domains/example/barbaz
# format (yaml)
#
# target_url_regex: redirect_to_url
#
# twitter を 開いたら google へ
# //twitter.com: https://google.com
# はてなブログのモバイル版ページをPCページへ
(http://d.hatena.ne.jp/.+/)touch/(.+): ${1}${2}
@fukayatsu
fukayatsu / AutoJumper.sample.yaml
Last active December 15, 2015 02:19
なんか跳ぶやつ
#
# format is yaml.
#
# url regex: "link selector(jquery)"
#
# 2chのクッションページを飛ばす
http://ime.nu/.+: "a:first"
# pixivのクッションページを飛ばす