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 | |
import os | |
from os import path | |
import re | |
import shutil | |
from itertools import chain | |
DEFAULT_SEPARATOR = "/" |
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
get %r|^/github(/.+\.js)$| do | |
require 'net/https' | |
uri = params[:captures].first | |
js = "" | |
github = Net::HTTP.new("raw.github.com", 443) | |
github.use_ssl = true # do not forget this to access with HTTPS protocol | |
github.start do | |
## XXX: verify the http response status |
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
--- pre.rwdImageMaps.js 2013-11-18 05:54:45.588799920 +0900 | |
+++ post.rwdImageMaps.js 2013-11-18 05:53:19.692799931 +0900 | |
@@ -37,6 +37,14 @@ | |
h = temp.height; | |
} | |
+ // To get the natural width and height on Webkit, just use this.(width/height) | |
+ if (!w || !h) { | |
+ if (!w) | |
+ w = this.width; |
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 "rubygems" | |
require "middleman-core/load_paths" | |
Middleman.setup_load_paths | |
require "middleman-core" | |
require "middleman-core/preview_server" | |
module Middleman::PreviewServer | |
def self.preview_in_rack |
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 'rack' | |
# Because String#each has taken away since RUBY_VERSION >= 1.9, | |
# Rack::BodyProxy#each causes error ( and when 'use Rakc::CommonLogger' ). | |
# This is the monkey patch to fix it. | |
class String | |
def each(*args, &block) | |
each_line *args, &block | |
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
diff --git a/autoload/unite/sources/outline/defaults/ruby.vim b/autoload/unite/sources/outline/defaults/ruby.vim | |
index eb53c82..116bf81 100644 | |
--- a/autoload/unite/sources/outline/defaults/ruby.vim | |
+++ b/autoload/unite/sources/outline/defaults/ruby.vim | |
@@ -19,6 +19,9 @@ function! unite#sources#outline#defaults#ruby#outline_info(...) | |
if path =~ '_spec\.rb$' | |
" RSpec | |
return 'ruby/rspec' | |
+ elseif path =~ 'Rakefile$' || path =~ '\.rake$' | |
+ " Rake |
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 | |
require 'htmlentities' | |
coder = HTMLEntities.new | |
p coder.encode('Φ', :named) #=> 'Φ' | |
p coder.decode('φ') #=> 'φ' |
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
### | |
# $ coffee -c loop.coffee ; nodejs loop.js | |
### | |
measure = (title, f) -> | |
begin = new Date() | |
f() | |
console.log "#{title}: #{(new Date() - begin)}" | |
times = 10000000 |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>closure pattern</title> | |
</head> | |
<body> | |
<div id="target1"> | |
<h1>Target 1</h1> | |
</div> |
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
// http://stackoverflow.com/questions/9141249/twitter-bootstrap-css-affecting-google-maps | |
// Below fixes Bootstrap(2.3)'s affection to Google Map V3's control which would be skinny looks. | |
// '#map' is a container of Google Map. | |
#map { | |
img { | |
max-width: none; | |
} | |
label { | |
width: auto; |