View wanco.rb
Dir["app/**/*.rb"].each do |file| | |
File.open(file, "rb+") do |io| | |
result = [] | |
body = io.read | |
body.split("\n").each do |line| | |
line.gsub!(/\s+\z/, "") | |
result << line | |
puts line |
View cat.rb
require "fileutils" | |
GOPATH = ENV["GOPATH"] | |
GO_SRC_PATH = GOPATH + "/src/github.com" | |
GHQ_ROOT = "/Users/tomohiro/.ghq/github.com" | |
def mv(src, dest) | |
# puts "mv #{src} #{dest}" | |
FileUtils.mv src, dest |
View main.rb
require "eldritch" | |
class Beer | |
def initialize(row, col) | |
@rows = row | |
@col = col | |
end | |
async def run(group) |
View gist:3c525a270e0840eb26c6
ruby -e'a={};$><<"\e[2J";loop{a[rand`tput cols`.to_i]=0;a.map{|x,o|$>.dup<<"\e[#{o};#{x}H \e[#{a[x]+=1};#{x}H\u{1f37a}\e[0;0H"};sleep 0.01}' |
View bind_tap.rb
module BindTap | |
def btap(&block) | |
self.instance_eval(&block) | |
self | |
end | |
end | |
Object.include BindTap |
View init.coffee
{BufferedProcess, View} = require 'atom' | |
class QuickrunView extends View | |
@content: -> | |
@div class: 'quickrun overlay from-top', => | |
@div class: 'panel', => | |
@div class: 'panel-heading', => | |
@span outlet: 'heading', 'quickrun' | |
@div class: 'btn-toolbar pull-right', => | |
@button class: 'btn close', 'X' |
View init.coffee
atom.project.eachEditor (editor) -> | |
buffer = editor.getBuffer() | |
atom.subscribe buffer, 'will-be-saved', -> | |
buffer.append("\n") |
View gist:6855391
diff --git a/Info.plist b/Info.plist | |
index 30cb05c..d856ed8 100644 | |
--- a/Info.plist | |
+++ b/Info.plist | |
@@ -42,6 +42,10 @@ | |
<true/> | |
<key>XCPluginHasUI</key> | |
<false/> | |
+ <key>DVTPlugInCompatibilityUUIDs</key> | |
+ <array> |
View gist:4771462
Preference-ENGINE:/Users/tomohiro:(---) 2.0.0-rc2 | |
2:16:> irb | |
irb(main):001:0> require 'fiddle' | |
=> true | |
irb(main):002:0> DL | |
NameError: uninitialized constant DL | |
from (irb):2 | |
from /Users/tomohiro/.rbenv/versions/2.0.0-rc2/bin/irb:12:in `<main>' | |
irb(main):003:0> |
View cat_removes_branch.rb
# coding: utf-8 | |
require 'readline' | |
branches = `git branch -r` | |
branches = branches.split(/\n/).map {|b| b.strip } | |
branches.shift | |
branches.delete_if {|branch| branch == 'origin/master' } | |
candidates = %w[check log grep open delete tag skip exit] |
NewerOlder