Skip to content

Instantly share code, notes, and snippets.

View keroxp's full-sized avatar

Yusuke Sakurai keroxp

View GitHub Profile
# -*- encoding: utf-8 -*-
require 'rubygems'
require 'eventmachine'
require 'em-rocketio-linda-client'
require 'arduino_firmata'
$stdout.sync = true
EM::run do
arduino = ArduinoFirmata.connect ENV["ARDUINO"], :eventmachine => true
puts "Arduino connect!! (firmata version v#{arduino.version})"
require 'arduino_firmata'
arduino = ArduinoFirmata.connect ENV["ARDUINO"]
puts "Arduino connect!! (firmata version v#{arduino.version})"
i = 0
loop do
# 正弦波で温度差を分ける
sin = Math.sin(i*Math::PI/180.0)
p sin
@keroxp
keroxp / fixissu.js
Created January 9, 2016 10:48
GithubのIssueページからfixedコミットメッセージを生成するブックマークレット
javascript:prompt("",function(){ var a = document.title.match(/^(.+)?· Issue (#\d+)/); return "fixed " + a[2] +" " + a[1]; }());
@keroxp
keroxp / BaseFragment.kt
Last active June 27, 2016 08:12
Fragment that logs lifecycle event.
import android.app.Activity
import android.app.Fragment
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
abstract class BaseFragment : Fragment() {
fun <O> Any.wrap(tag: String, body: () -> O): O {
@keroxp
keroxp / SecureValues.cs
Last active October 5, 2018 06:55
Data holder class for secure value.
/*
The MIT License (MIT)
Copyright (c) 2017 Yusuke Sakurai / @keroxp.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
@keroxp
keroxp / dvorak-jp-sakura.txt
Last active September 3, 2022 13:31
DvorakJP桜ローマ字変換テーブル
- ー
~ 〜
. 。
, 、
;/ ・
;- 〜
;[ 『
;] 』
[ 「
] 」