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
=begin | |
Generates grey-scale based contrasted color | |
from rgb hex string. | |
=end | |
yellow = "#FFFF99" | |
red = "#FF6666" | |
grey = "#777777" |
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 "active_support" | |
require "active_support/core_ext" | |
KLASSNAME = "PSDatabasePeak" | |
props = DATA.readlines.map do |line| | |
line.split("\s").select(&:present?).last[/^\*?([^;]+);$/,1] | |
end | |
# puts %|return [NSString stringWithFormat:@"<#{KLASSNAME} #{props.map{|s| "@#{s}=%@" }.join("\s")}>", #{props.map{|s| "self.#{s}" }.join(",\s")}];| |
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
#compdef tmuxinator mux | |
# zsh completion for tmuxinator | |
# Install: | |
# $ mkdir -p ~/.tmuxinator/completion | |
# $ cp _tmuxinator ~/.tmuxinator/completion | |
# $ vi ~/.zshrc # add the following codes | |
# fpath=($HOME/.tmuxinator/completion ${fpath}) | |
# autoload -U compinit |
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 "yaml" | |
require "coffee-script" | |
YAML.load(DATA.read).values.each do |src| | |
puts CoffeeScript.compile src | |
puts "-" * 30 | |
end | |
=begin |
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
def my_bp | |
while true | |
print "Breakpoint > " | |
input = (gets || "\n").chomp.strip | |
break if input.empty? || input =~ /^exit$/ | |
instance_eval("puts #{input}.inspect") |
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
class Base | |
class << self | |
def set! | |
@@_var_ = "var!" | |
end | |
def get! | |
@@_var_ | |
end | |
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
module ListenExt | |
module Record | |
module SymlinkDetector | |
ERROR_MESSAGE = "Failed due to looped symlinks" | |
def verify_unwatched!(entry) | |
begin | |
super(entry) | |
rescue => e |
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/bash | |
set -eu | |
# TODO: summary | |
REPO_PATH=${1:-""} # the first argument should be a directory to demodulize. |
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 | |
desc "all" | |
task all: %i[clean prepare] | |
=begin | |
- ξ(✿>◡❛)ξ tar --exclude 'a/A/a' -zcf test.tgz test | |
- ξ(✿>◡❛)ξ tar ztf test.tgz |
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
find -name '*.json' -exec ls -s {} \; | ruby -e 'p STDIN.readlines.map(&:to_i).reduce(&:+)' |