This file contains hidden or 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 'net/http' | |
Net::HTTP.version_1_2 | |
require 'json' | |
class BitLy | |
def initialize(params={}) | |
@base_query = "version=2.0.1&login=#{params[:id]}&apiKey=#{params[:api_key]}" | |
end |
This file contains hidden or 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_current_position = () => | |
navigator.geolocation.getCurrentPosition @nearby_places, @failed_alert | |
@nearby_places = (position) => | |
res = $.getJSON "/places/nearby.json", { lat: position.coords.latitude, long: position.coords.longitude }, | |
(json) -> | |
Gmaps.map.replaceMarkers json | |
@failed_alert = () => | |
alert "failed to get current position." |
This file contains hidden or 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
# forked from http://kray.jp/blog/rails3-fileupload/ | |
def _store_upload(file) | |
if request.xhr? | |
if request.body.size == request.headers['CONTENT_LENGTH'].to_i | |
file_data = request.body.read | |
file_name = file | |
end | |
else | |
if file.instance_of?(File) | |
file_data = file.read |
This file contains hidden or 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
# initializer for fileuploader.js(http://github.com/valums/file-uploader) | |
@create_uploader = (upload_action, complete_action, token) => | |
uploader = new qq.FileUploader { | |
element: document.getElementById('upload'), | |
action: upload_action, | |
debug: false, | |
params: { | |
authenticity_token: token | |
}, | |
onComplete: () => |
This file contains hidden or 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
namespace :assets do | |
task :precompile, :roles => :web, :except => { :no_release => true } do | |
from = source.next_revision(current_revision) | |
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0 | |
run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile} | |
else | |
logger.info "Skipping asset pre-compilation because there were no asset changes" | |
end | |
end | |
end |
This file contains hidden or 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
set :rails_env, 'staging' | |
set :branch, 'trunk' | |
set :deploy_to, "/var/www/#{application}-#{rails_env}" | |
role :web, "staging-server" | |
role :app, "staging-server" | |
role :db, "staging-server", :primary => true |
This file contains hidden or 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
set(:deploy_to) { "/var/www/#{application}-#{rails_env}" } | |
set(:releases_path) { File.join(deploy_to, version_dir) } | |
set(:shared_path) { File.join(deploy_to, shared_dir) } | |
set(:current_path) { File.join(deploy_to, current_dir) } | |
set(:release_path) { File.join(releases_path, release_name) } | |
# unicornを使っているなら以下も | |
set(:unicorn_config) { "#{current_path}/config/unicorn.rb" } | |
set(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" } |
This file contains hidden or 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
--- a/src/nsterm.m 2012-03-20 12:48:57.000000000 +0900 | |
+++ b/src/nsterm.m 2012-03-20 13:22:16.000000000 +0900 | |
@@ -4708,9 +4708,7 @@ | |
if (NS_KEYLOG) | |
NSLog (@"firstRectForCharRange request"); | |
- if (NILP (Feval (Fcons (intern ("ns-in-echo-area"), Qnil)))) | |
- win = XWINDOW (FRAME_SELECTED_WINDOW (emacsframe)); | |
- else if (WINDOWP (echo_area_window)) | |
+ if (WINDOWP (echo_area_window)) |
This file contains hidden or 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
.bgimage { | |
background: #fffff url("<%= asset_path 'css/background.png' %>") repeat-x; | |
} |
This file contains hidden or 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
.bgimage { | |
background: #fffff url(asset-path('css/background.png', image)) repeat-x; | |
} |
OlderNewer