ローカルのomniauth.ymlにheroku用の設定を書いておいて、
$ rake heroku_config:upload
すればherokuに設定がコピーされます。
ローカルのomniauth.ymlにheroku用の設定を書いておいて、
$ rake heroku_config:upload
すればherokuに設定がコピーされます。
require 'rubygems' | |
require 'ruby-prof' | |
RubyProf.measure_mode = RubyProf::ALLOCATIONS | |
RubyProf.start | |
1_000_000.times{ Array.new(10) } | |
result = RubyProf.stop | |
# Print a flat profile to text | |
printer = RubyProf::FlatPrinter.new(result) | |
printer.print(STDOUT) |
require 'rack' | |
class App | |
def call(env) | |
html = %Q!<html><body style="margin:0"><img src="http://30d.jp/img/kyanny/public/80a57ec4-fc89-11e1-9cd3-00262d09affa_original.jpg" /></body></html>! | |
[200, {'content-type' => 'text/html'}, [html]] | |
end | |
end | |
run App.new |
console.log('hi'); | |
window.Todos = Ember.Application.create(); | |
Todos.Todo = Ember.Object.extend({ | |
title: null, | |
isDone: false | |
}); | |
Todos.todosController = Ember.ArrayController.create({ | |
content:[], |
// NSString* url = [NSString stringWithFormat:@"http://api.twitter.com/1/users/profile_image?size=normal&screen_name=%@", [screenName gtm_stringByEscapingForURLArgument]]; | |
NSString *url = [NSString stringWithFormat:@"http://n.hatena.ne.jp/%@/profile/image?type=face", screenName]; // はてなのURLに変更 |
#!/usr/bin/env ruby | |
while ARGF.readline | |
puts $. | |
begin | |
$_.match /./ | |
rescue => e | |
puts $_ | |
raise e | |
end |
CONFIGURE_OPTS="--with-out-ext=tk,tk/* --with-opt-dir=`brew --prefix openssl`:`brew --prefix readline`" rbenv install 2.0.0-dev |
class ApplicationController < ActionController::Base | |
# see also: http://stackoverflow.com/questions/2385799/how-to-redirect-to-a-404-in-rails | |
def not_found! | |
raise ActionController::RoutingError.new('Not Found') | |
end | |
end |
export PS1='\[\033k'"$HOSTNAME"'\033\\\]'"$PS1" |
require 'uri' | |
require 'net/http' | |
class Chunked | |
def initialize(data, chunk_size) | |
@size = chunk_size | |
if data.respond_to? :read | |
@file = data | |
end | |
end |