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
# -*- coding: UTF-8 -*-; | |
def dot(index) | |
index = index & 7 | (index & 112) >> 1 | (index & 8) << 3 | index & 128 | |
case index | |
when 0 | |
" " | |
else | |
[0x2800 + index].pack('U*') | |
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
message | |
---------------------> | |
,---!. | |
|eat|_\ |
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 | |
# -*- coding: UTF-8 -*-; | |
gem 'text_layout' | |
require 'optparse' | |
require 'text_layout' | |
require 'set' | |
opts = OptionParser.new <<EOS |
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 | |
i = 0 | |
hash = {} | |
edges = '' | |
ARGF.each do |line| | |
id1, id2s = line.strip.split /\s/ | |
id2s.split(",").each do |id2| | |
hash[id1] ||= i += 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
#!/usr/bin/osascript | |
tell application "Terminal" | |
contents of selected tab of front window | |
end tell |
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
diff: 2100 | |
*path*: 120 | |
.: 75 | |
--help: 19 | |
-p: 15 | |
-w: 14 | |
--no-color: 3 | |
--: 14 | |
*path*: 10 | |
--no-color: 13 |
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::MRuby | |
extend ::FFI::Library | |
ffi_lib 'ritevm' | |
enum :mrb_vtype, [ | |
:FALSE, :FREE, :TRUE, :FIXNUM, | |
:SYMBOL, :UNDEF, :FLOAT, :OBJECT, |
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 Union | |
extend ::FFI::Library | |
ffi_lib 'union' | |
class U < FFI::Union | |
layout( | |
:d, :double, | |
:i, :int |
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
#include <stdio.h> | |
typedef union { | |
double d; | |
int i; | |
} union_t; | |
void dump_union(union_t u) { | |
unsigned char *c = (unsigned char *)&u; |
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 | |
# -*- coding: UTF-8 -*-; | |
require 'thread' | |
require 'time' | |
class App | |
Bus = Struct.new :draw, :visualize | |
Info = Struct.new :title, :text |