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
function! s:syntax(name, ext) | |
let l:separator = "^# ============================================================ " | |
let l:ext = empty(a:ext) ? "" : "¥¥.".a:ext | |
let l:cmd = "syntax region GEBlock".a:name | |
¥." matchgroup=FileLine " | |
¥."start=/".l:separator.".*¥¥v".l:ext."$/ " | |
¥."end=/¥¥(".l:separator.".*$¥¥)¥¥@=¥¥|¥¥%$/ " | |
¥."keepend transparent contains=FileLine" | |
let l:cmd .= empty(a:name) ? "" : ",@".a:name |
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
require 'ffi' | |
module FFI::PortAudio | |
module API | |
extend FFI::Library | |
ffi_lib 'portaudio' | |
Int16 = 0x8 | |
FramesPerBufferUnspecified = 0 |
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
require 'rubygems' | |
require 'ffi-portaudio' | |
def safe | |
r = nil | |
Thread.new { | |
$SAFE = 4 | |
r = yield | |
}.join | |
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
require 'ffi' | |
module FFI::Ruby | |
class Value | |
class << self | |
extend ::FFI::Library | |
ffi_lib 'ruby' | |
attach_function :rb_obj_id, [:pointer], :pointer | |
attach_function :rb_num2long, [:pointer], :long |
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/env ruby | |
require 'pathname' | |
pattern = ARGV.shift | |
dir = ARGV.shift || Dir.pwd | |
Pathname(dir).expand_path.ascend{|d| puts Dir.glob(d + pattern)} |
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
関西闇Ruby会議の参加者の方へ | |
3日連続でお疲れ様でした。いま僕はVim勉強会と関西闇Ruby勉強会と関西闇Ruby勉強会公式残業会の全てを終えて帰途についている電車の中でこのメールを書いているところです。 | |
関西闇Ruby会議は家に帰ってブログを書いて投稿するまでが関西闇Ruby会議です。ブログを投稿するだけでなく、ハッシュタグ | |
#kyami | |
をつけてtwitterなどにそのURLを投稿すると、後日RubyKaigi Nikkiなどに書かれる予定のまとめ記事からリンクされるので、便利です。 |
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
import qualified Text.Parsec as P | |
import Control.Applicative | |
import Control.Monad (liftM, liftM2, msum) | |
data AST = | |
ClassDeclaration AST AST (Maybe AST) (Maybe AST) (Maybe AST) | | |
Identifier String | | |
Keyword String | | |
Comment String | | |
ClassModifiers [AST] | |
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
import qualified Text.Parsec as P | |
import Control.Applicative | |
import Control.Monad (msum) | |
main = do | |
P.parseTest primitive0 "short" | |
P.parseTest primitive1 "byte" | |
P.parseTest primitive2 "char" | |
primitive0 = do |
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
<!-- | |
java.awt.Color -> System.Drawing.Color | |
new Color(int,int,int) -> System.Drawing.Color.FromArgb(255, @1, @2, @3) | |
.black -> .BLACK | |
.setEnabled(boolean) -> .Enabled = ... | |
--> | |
<mapping> | |
<packages> | |
<package name="java.awt"> |
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/env ruby | |
require 'nokogiri' | |
SEPARATOR = '->' | |
class ClassInfo | |
attr_reader :packageName, :name | |
def initialize(qualified_name) | |
names = qualified_name.split '.' |