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 'nokogiri' | |
require 'eeepub' | |
DOC_TITLE = 'Ruby on Rails Guides' | |
def get_pages(src_dir) | |
index_file = File.join(src_dir, 'index.html') | |
section = nil | |
pages = [{ :section => section, :title => DOC_TITLE, :path => index_file }] |
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
function convertWithLang(timeAgo, lang) { | |
if (lang == "ja") | |
return toJa(timeAgo); | |
return timeAgo; | |
} | |
function convert(timeAgo, dict, strip) { | |
var delim = " "; | |
var arr = timeAgo.split(delim); |
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 Shoulda | |
module Matchers | |
module ActiveRecord | |
def have_store_accessor(key) | |
HaveStoreAccessor.new(key) | |
end | |
class HaveStoreAccessor | |
def initialize(key) | |
@key = key |
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
public class Singleton { | |
public static var getInstance:Function = function():Singleton { | |
var instance:Singleton = new Singleton(); | |
getInstance = function():Singleton { | |
return instance; | |
}; | |
return getInstance(); |
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
RUBYOPT="-r rubygems" rbenv exec bundle install --path vendor/bundle |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>homebrew.mxcl.jenkins</string> | |
<key>ProgramArguments</key> | |
<array> | |
<string>/usr/bin/java</string> | |
<string>-Dfile.encoding=UTF-8</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
#!/bin/bash -e | |
NAME="YOUR JAPANESE LAST NAME" | |
DATE=`date '+%Y-%m-%d'` | |
URL="https://airshq.atlassian.net/wiki/pages/createblogpost.action?spaceKey=AIRS&title=$DATE+$NAME" | |
open $URL |
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 Foo | |
def self.included(base) | |
base.class_eval do | |
before_filter :admin_required | |
end | |
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
git remote add origin my://server/repo.git | |
git config branch.master.remote origin | |
git config branch.master.merge refs/heads/master |
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
MKCoordinateRegion region = mapView.region; | |
CLLocationCoordinate2D topLeftCoordinate = | |
CLLocationCoordinate2DMake(region.center.latitude + (region.span.latitudeDelta / 2.0), | |
region.center.longitude - (region.span.longitudeDelta / 2.0)); | |
CLLocationCoordinate2D bottomRightCoordinate = | |
CLLocationCoordinate2DMake(region.center.latitude - (region.span.latitudeDelta / 2.0), | |
region.center.longitude + (region.span.longitudeDelta / 2.0)); | |
MKMapPoint topLeftMapPoint = MKMapPointForCoordinate(topLeftCoordinate); |
NewerOlder