This file contains hidden or 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
class BinaryTree | |
constructor: () -> | |
class BinaryTreeNode extends BinaryTree | |
constructor: (@value, @left, @right) ->Object.freeze(@) | |
isEmpty: () -> false | |
depth: () -> 1 + Math.max(@left.depth(), @right.depth()) | |
count: () -> 1 + @left.count() + @right.count() | |
inorder: (fn) -> @left.inorder(fn); fn(@value); @right.inorder(fn) |
This file contains hidden or 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
MRuby::GemBox.new do |conf| | |
conf.gem :github => 'iij/mruby-digest' | |
conf.gem :github => 'iij/mruby-io' | |
conf.gem :github => 'iij/mruby-socket' | |
conf.gem :github => 'iij/mruby-regexp-pcre' | |
conf.gem :github => 'iij/mruby-pack' | |
conf.gem :github => 'dorentus/mruby-bnet-authenticator' | |
end |
This file contains hidden or 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
MRuby::Build.new do |conf| | |
toolchain :clang | |
conf.gembox 'default' | |
end | |
def crossbuild_for(name, platform, sysroot, cc_defines = []) | |
MRuby::CrossBuild.new(name) do |conf| | |
toolchain :clang | |
conf.gembox 'default' |
This file contains hidden or 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
rails new myapp -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb |
This file contains hidden or 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
[Unit] | |
Description=Shadowsocks Server | |
After=network.target | |
[Service] | |
Type=forking | |
PIDFile=/run/shadowsocks/server.pid | |
PermissionsStartOnly=true | |
ExecStartPre=/bin/mkdir -p /run/shadowsocks | |
ExecStartPre=/bin/chown nobody:nogroup /run/shadowsocks |
This file contains hidden or 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
[Unit] | |
Description=SPDY proxy | |
After=network.target | |
[Service] | |
Type=forking | |
PIDFile=/run/spdylay/shrpx.pid | |
EnvironmentFile=/etc/default/shrpx | |
PermissionsStartOnly=true | |
ExecStartPre=/bin/mkdir -p /run/spdylay |
This file contains hidden or 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 | |
# 08:02:34 => oh 8 oh 2 hours and 34 seconds | |
# 08:00:01 => oh 8 hundred hours and 1 second | |
# 14:32:10 => 14 32 hours and 10 seconds | |
def telltime ใใพ | |
h, m, s = { | |
:hour => nil, | |
:min => [' hundred hours', ' %{text} hours'], |
This file contains hidden or 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
PS1_SYM='\$' | |
if [ -x $HOME/bin/choose_by_hostname ]; then | |
PS1_SYM=$($HOME/bin/choose_by_hostname ๐ ๐พ ๐ โญ ๐ ๐) | |
fi | |
export PS1='\n\[\e[0;30m\]โโ\[\e[0m\]\[\e[01;30m\]\u@\h\[\e[00m\]:\[\e[01;34m\]\w\[\e[00m\]\n\[\e[0;30m\]โโโโ\[\e[0m\]${PS1_SYM} \[\e[00;33m\]$(__git_ps1 "(%s)")\[\e[00m\] ' |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>my.example.shadowsocks-libev</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/local/opt/shadowsocks-libev/bin/ss-local</string> | |
<string>-c</string> |