This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
#YAMLファイルを読み込んでERBで整形するだけ | |
#YAMLファイルとテンプレートファイルを引数にとり、整形したのを標準出力に書き出す | |
require 'yaml' | |
require 'erb' | |
require 'kconv' | |
yaml = "" | |
#一個目のファイルはYAMLデータとみなす |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* ==VimperatorPlugin== | |
* @name uxu_vimp | |
* @description Be able to open UxU interface from :dia[log]. | |
* @description-ja UxUのダイアログを:dia[log]コマンドで開けるようにします。 | |
* @author koki-h | |
* @version 0.1 | |
* ==/VimperatorPlugin== | |
*/ | |
//This script is based on http://vimperator.g.hatena.ne.jp/hogelog/20081213/1229199895 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# 引数に指定されたディレクトリとカレントディレクトリのファイルからタグファイルを生成する | |
# | |
remort_src=$1 | |
find ../$remort_src/ | ctags -L - | |
ctags -a -R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#WAVEファイルを解析する | |
#dumpした結果を折れ線グラフなどにすれば波形を見ることが出来る | |
require 'pp' | |
include Math | |
class String | |
def to_long | |
self.unpack("L*")[0] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name twitter_page | |
// @namespace koki-h | |
// @description http://twitter.com/ にアクセスしたときにlocationに自動で"?page=1"を付加する。 | |
// @include http://twitter.com/ | |
// ==/UserScript== | |
// | |
//vimperatorを使っていれば"Ctrl+a"で次のページ、"Ctrl+x"で前のページに移動できる | |
document.location += "?page=1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Twitterの過去ログを取ってきてタブ区切りで1ページずつ書き出す | |
require 'rubygems' | |
require 'nokogiri' | |
require 'open-uri' | |
require 'date' | |
MIN_PAGE = ARGV[0] | |
MAX_PAGE = ARGV[1] | |
#MAX_PAGE = 2 | |
# Get a Nokogiri::HTML:Document for the page we’re interested in... | |
MIN_PAGE.upto MAX_PAGE do |i| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//9個のLEDを1個づつ光らせていく | |
//http://www.youtube.com/watch?v=7TdfvWGedBA | |
#define LED_PIN_MIN 2 | |
#define LED_PIN_MAX 10 | |
void setup() // run once, when the sketch starts | |
{ | |
for (int i = LED_PIN_MIN; i <= LED_PIN_MAX; i++){ | |
pinMode(i, OUTPUT); // sets the digital pin as output | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//点滅速度を早くし、往復するようにした(ナイトライダー) | |
#define LED_PIN_MIN 2 | |
#define LED_PIN_MAX 10 | |
void setup() // run once, when the sketch starts | |
{ | |
for (int i = LED_PIN_MIN; i <= LED_PIN_MAX; i++){ | |
pinMode(i, OUTPUT); // sets the digital pin as output | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//にせもののanalogWriteを作ろうと思ったけど失敗。 | |
//ちゃんとanalogWriteするためには各ピンに連続的にON/OFFを送り続けないとダメ | |
#define LED_PIN_MIN 2 | |
#define LED_PIN_MAX 10 | |
#define MICROSECONDS_PER_BLINK 2040 //PWMの周波数約490Hzより | |
#define NUMBER_OF_LEVEL 4 //PWMの段階 | |
#define UNIT_OF_LEVEL MICROSECONDS_PER_BLINK / NUMBER_OF_LEVEL | |
void setup() // run once, when the sketch starts | |
{ |
OlderNewer