- U+200E - left-to-right mark (LRM)
- U+200F - right-to-left mark (RLM)
- U+202A - left-to-right embedding (LRE)
- U+202B - right-to-left embedding (RLE)
- U+202C - pop directional formatting (PDF)
- U+202D - left-to-right override (LRO)
- U+202E - right-to-left override (RLO)
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 | |
def ask(message) | |
print "#{message} [Y/n] " | |
case gets.strip | |
when /n/i | |
else | |
yield | |
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
Show hidden characters
{ | |
"run_rspec_command": "spring rspec {relative_path} --no-color", | |
"run_single_rspec_command": "spring rspec {relative_path}:{line_number} --no-color" | |
} |
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
# fix assets loading performance in 3.2.13 | |
# see: | |
# * https://github.com/rails/rails/commit/687e68d88f5e1a7bb6a2d876fbbc5b8c4571d853 | |
# * https://github.com/rails/rails/issues/9803 | |
if Rails.env.development? && Rails.version == "3.2.13" | |
module Sprockets | |
module Helpers | |
module RailsHelper | |
class AssetPaths | |
def rewrite_extension(source, dir, ext) |
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 scala.tools.nsc.{ast, Settings} | |
import scala.tools.nsc.interpreter._ | |
import scala.tools.nsc.util.BatchSourceFile | |
class ScalaParser { | |
val settings = new Settings() | |
settings.usejavacp.value = true | |
val main = new IMain(settings) | |
import main.global._ |
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 scala.tools.nsc.Settings | |
import scala.tools.nsc.interpreter.{ExprTyper, IMain} | |
object Example extends App { | |
val settings = new Settings() | |
settings.usejavacp.value = true | |
val main = new IMain(settings) | |
object exprTyper extends { val repl: main.type = main } with ExprTyper { } | |
val result = exprTyper.parse( |
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
text = File.open('./UTF-16-with-BOM.txt', 'rb') {|f| f.read} | |
case text[0..1].bytes | |
when "\xFE\xFF".bytes | |
encoding = 'UTF-16BE' | |
when "\xFF\xFE".bytes | |
encoding = 'UTF-16LE' | |
else | |
encoding = 'US-ASCII' | |
end | |
puts text.encode('UTF-8', encoding) |
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
# encoding: utf-8 | |
Earthquake.init do | |
_ = config[:screensaver] ||= {} | |
_[:pattern] ||= /screen ?saver|スクリーンセーバー/i | |
_[:command] ||= %(open -a /System/Library/Frameworks/ScreenSaver.framework/Versions/A/Resources/ScreenSaverEngine.app) | |
output_filter do |item| | |
next unless item["_stream"] && item["text"] | |
next unless item["user"]["screen_name"] == twitter.info["screen_name"] | |
if item["text"] =~ _[:pattern] |
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 Kernel | |
def ir(binding) | |
binding.pry | |
end | |
alias_method :b, :binding | |
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
… | |
gem 'ruby-prof' |