- Put this code at #{Rails.root}/db/seeds.rb
- type
rake db:setup
It supports only `id' primary key.
diff --git a/load.c b/load.c | |
index 0ff4b60..34fd8ca 100644 | |
--- a/load.c | |
+++ b/load.c | |
@@ -130,11 +130,18 @@ loaded_feature_path_i(st_data_t v, st_data_t b, st_data_t f) | |
} | |
static int | |
+rb_find_feature_left_place(VALUE features, const char *feature, long flen); | |
+static int |
#!/usr/bin/ruby | |
# | |
# = 元ネタ | |
# | |
# Kawaz - Pythonで文字列からクラスインスタンスを生成したりメソッドを呼ぶ方法 | |
# | |
# http://www.kawaz.org/blogs/miiojp/2011/05/15/106/ | |
# | |
# 上記ページでは、Pythonで "hogehoge.hogenoho.HogeClass" のような文字列に |
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | |
// for details. All rights reserved. Use of this source code is governed by a | |
// BSD-style license that can be found in the LICENSE file. | |
// Simple test program invoked with an option to eagerly | |
// compile all code that is loaded in the isolate. | |
// VMOptions=--compile_all | |
class HelloDartTest { | |
static testMain() { | |
print("Hello, Darter!"); |
# 第2回 Tuningathon チューニングメモ | |
このメモは @hamano が [第2回 Tuningathon][1] に参加した際に行ったチュー | |
ニングポイントと感想です。 | |
[1]: http://www.zusaar.com/event/agZ6dXNhYXJyDQsSBUV2ZW50GLmFBgw "第2弾!いろいろチューニングしてパフォーマンスを競うバトルイベント開催!「Tuningathon」2!! #tuningathon" | |
今回のお題は MediaWiki への参照性能という事でまたPHPか! とは思いました | |
が2台構成可、Web Serverの入れ替え可、という条件でしたのでチューニングの | |
範囲が大きく広がった様に感じました。 |
Install rbenv and ruby-build to Amazon Linux (cloud-init).
user-data.sh
to EC2 RunInstances user-datainstall-ruby.sh
.#!/bin/sh | |
#============================= | |
# make work directory | |
#============================= | |
mkdir -p $HOME/local/fcgi/src | |
cd $HOME/local/fcgi/src | |
#============================ | |
# install fcgi |
# Allow the metal piece to run in isolation | |
require(File.dirname(__FILE__) + "/../../config/environment") unless defined?(Rails) | |
class GoogleAnalytics | |
extend Rack::Utils | |
G_COOKIE_NAME = '__utmmobile' | |
GIF_DATA = "GIF89a\001\000\001\000\200\000\000\377\377\377\377\377\377!\371\004\001\n\000\001\000,\000\000\000\000\001\000\001\000\000\002\002L\001\000;" | |
UTM_GIF_LOCATION = "http://www.google-analytics.com/__utm.gif"; |
namespace :heroku do | |
desc "PostgreSQL database backups from Heroku to Amazon S3" | |
task :backup => :environment do | |
begin | |
require 'right_aws' | |
puts "[#{Time.now}] heroku:backup started" | |
name = "#{ENV['APP_NAME']}-#{Time.now.strftime('%Y-%m-%d-%H%M%S')}.dump" | |
db = ENV['DATABASE_URL'].match(/postgres:\/\/([^:]+):([^@]+)@([^\/]+)\/(.+)/) | |
system "PGPASSWORD=#{db[2]} pg_dump -Fc --username=#{db[1]} --host=#{db[3]} #{db[4]} > tmp/#{name}" | |
s3 = RightAws::S3.new(ENV['s3_access_key_id'], ENV['s3_secret_access_key']) |
// This is my handler in the javascript | |
var uploadCompleteHandler = function(upload_options,event){ | |
$.ajax({ | |
url: '<%= notify_rails_of_successful_upload_path(:format => :js)%>', | |
global: false, | |
type: 'POST', | |
data: ({ | |
'authenticity_token' : '<%= form_authenticity_token %>', | |
'upload' : { | |
'file_file_name' : upload_options.FileName, |