Skip to content

Instantly share code, notes, and snippets.

View emsk's full-sized avatar

Masaki Enjo emsk

View GitHub Profile
require 'octokit'
MGEM_LIST_REPO = 'mruby/mgem-list'
client = Octokit::Client.new(access_token: '') # Note: Set access token
files = client.contents(MGEM_LIST_REPO)
puts "count of files: #{files.size}"
files.each do |f|
@emsk
emsk / imagine.rb
Created May 5, 2014 12:30
Imagine. Implement. Iterate. Improve. - http://tuhin.co/great-designers.html
%W[(L@FHMD\r (LOKDLDMS\r (SDQ@SD\r (LOQNUD\r].each do |w|
w.bytes do |c|
sleep(0.2)
printf('%c ', c + '!'.ord)
end
puts
end
@emsk
emsk / ambientNoren.ino
Created January 13, 2014 02:45
ambient noren
/**
* ambient noren (Arduino)
*
* Receive z-axis acceleration from sensor and send it.
*
* - Mac OS X 10.8.5 Mountain Lion
* - SuperCollider 3.6.5 ... http://supercollider.sourceforge.net/
* - LilyPad Arduino USB ... https://www.sparkfun.com/products/11190
* - LilyPad Accelerometer ADXL335 ... https://www.sparkfun.com/products/9267
* - Flora Accelerometer LSM303 ... http://www.adafruit.com/products/1247
@emsk
emsk / guitarSound.sc
Created November 18, 2013 14:59
シリアルポートから取得した加速度データによって音を鳴らす
/*
Receive sensor data and play guitar sound.
- Mac OS X 10.6.8 Snow Leopard
- SuperCollider 3.6.5
- LilyPad Arduino USB ... https://www.sparkfun.com/products/11190
- FLORA Accelerometer (LSM303) ... http://www.adafruit.com/products/1247
*/
// 1. boot
@emsk
emsk / sendZAxisAcceleration.ino
Created November 18, 2013 14:59
加速度データを取得してシリアルポートに出力
/*
Send z-axis acceleration.
- LilyPad Arduino USB ... https://www.sparkfun.com/products/11190
- FLORA Accelerometer (LSM303) ... http://www.adafruit.com/products/1247
*/
#include <Wire.h>
#include <LSM303.h>
@emsk
emsk / notes.rake
Created March 25, 2013 06:33
rake notes 探索対象ディレクトリに spec ディレクトリを追加
class SourceAnnotationExtractor
def find_with_custom_directories
find_without_custom_directories(%w(app config lib script test spec))
end
alias_method_chain(:find, :custom_directories)
end
@emsk
emsk / mood.rb
Created January 26, 2013 08:40
just change Skype mood message
#!/usr/bin/env ruby
# coding: utf-8
require 'skypemac'
mood_text = ARGV[0]
profile = SkypeMac::Profile.new(nil)
profile.mood_text = mood_text
@emsk
emsk / hack_hacker_news.rb
Created July 10, 2012 13:14
Hacker News RSS から指定した文字列を検索して Growl で通知
# coding: utf-8
#
# Hacker News RSS 通知
#
# Hacker News RSS から指定した文字列を検索して Growl で通知する。
#
require 'rubygems'
require 'nokogiri'