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
on handle_string(theString) | |
do shell script "~/bin/subl " & theString | |
end handle_string |
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
[0x304B, 0x3099].pack('U*') | |
#=> "が" | |
[0x304B, 0x3099].pack('U*').bytes | |
#=> [227, 129, 139, 227, 130, 153] | |
require 'unf' | |
#=> true | |
[0x304B, 0x3099].pack('U*').to_nfc | |
#=> "が" | |
[0x304B, 0x3099].pack('U*').to_nfc.bytes | |
#=> [227, 129, 140] |
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 sublime | |
from git import GitWindowCommand, plugin_file | |
class GitCommitShowCommand(GitWindowCommand): | |
def run(self): | |
if self.active_view() != None: | |
sha1 = self.active_view().substr(self.active_view().sel()[0]) | |
if sha1 != "": | |
self.git_commit_show(sha1) | |
else: |
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/sh | |
curl $* | python -mjson.tool |
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 sublime_plugin | |
class FileNameOnStatusBar(sublime_plugin.EventListener): | |
def on_activated(self, view): | |
path = view.file_name() | |
if path: | |
for folder in view.window().folders(): | |
path = path.replace(folder + '/', '', 1) | |
view.set_status('file_name', path) | |
else: |
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
worker: RAILS_ENV=production bundle exec sidekiq -C config/sidekiq.yml |
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
# Configuration | |
# ------------- | |
# | |
# Earthquake.config[:english] = { | |
# ignore: /jugyo|yukihiro_matz/, | |
# highlight: /ruby|rails|sublime|git|twitter/i | |
# } | |
# | |
Earthquake.init do | |
_ = config[:english] ||= {} |
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 Array | |
def u | |
pack('U*') | |
end | |
end | |
class Fixnum | |
def u | |
[self].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
$ CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline) --with-openssl-dir=$(brew --prefix openssl)" rbenv install 1.9.3-p374 |
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
Earthquake.once do | |
require 'webmock' | |
require 'logger' | |
logger = Logger.new(File.join(Earthquake.config[:dir], 'api.log')) | |
WebMock.allow_net_connect! | |
WebMock.after_request do |request, response| | |
logger.info "#{request.method.upcase} #{request.uri} #{request.body}" | |
logger.info response.status.join(' ') | |
logger.info response.body | |
logger.info response.headers.map {|key, val| "#{key}: #{val}" }.join("\n") |