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/sh | |
mkdir -p /usr/local/src && cd /usr/local/src | |
wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.1-p0.tar.bz2 | |
tar -xjvf ruby-1.9.1-p0.tar.bz2 | |
cd ruby-1.9.1-p0 | |
./configure --prefix=/usr --program-suffix=19 --enable-shared | |
make && make install |
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
CmdUtils.CreateCommand({ | |
name: "dictcn", | |
author: { | |
name: "Hu Ziming", | |
email: "[email protected]" | |
}, | |
contributors: ["Hu Ziming", "azuwis"], | |
icon : "http://dict.cn/favicon.ico", | |
description: "Consulting the word from <a>http://dict.cn</a>.", | |
help: "Consulting the word from <a>http://dict.cn</a>.", |
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
puts <<ASCII | |
/´¯/) | |
,/¯ / | |
/ / | |
/´¯/' '/´¯¯`·¸ | |
/'/ / / /¨¯\\ | |
('( ´ ´ ¯~/' ') | |
\\ ' / | |
'' \\ _ ·´ | |
\\ ( |
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
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
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
user app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
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
# 在本地服务器建立 rubygems.org 的镜像缓存,以提高 gem 的安装速度 | |
# 此配置设置缓存过期为1天,也就是说,新上的 gem 无法马上安装 | |
# 做这个起什么作用? | |
# rubygems 的很多资源文件是存放到 Amazon S3 上面的,由于 GFW 对某些 S3 服务器又连接重置或丢包,导致 gem 安装异常缓慢或有时候根本无法连接安装。 | |
# 而通过这种跳板的方式可以很好的解决这个问题,当然前提是 Nginx反向代理 服务器需要在国外 | |
proxy_cache_path /var/cache/rubygems levels=1:2 keys_zone=RUBYGEMS:10m | |
inactive=24h max_size=1g; | |
server { | |
listen 80; |
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/sh | |
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the | |
# CREATE block and create them in separate commands _after_ all the INSERTs. | |
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk. | |
# The mysqldump file is traversed only once. | |
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite | |
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite |
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
class MigrateUsers < ActiveRecord::Migration | |
def self.up | |
rename_column :users, :crypted_password, :encrypted_password | |
add_column :users, :confirmation_token, :string, :limit => 255 | |
add_column :users, :confirmed_at, :timestamp | |
add_column :users, :confirmation_sent_at, :timestamp | |
execute "UPDATE users SET confirmed_at = created_at, confirmation_sent_at = created_at" | |
add_column :users, :reset_password_token, :string, :limit => 255 |
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
-- | |
provider: twitter | |
uid: '15280529' | |
info: | |
nickname: penguinbusiness | |
name: Charlie Moseley | |
location: Bellevue, WA | |
image: http://a1.twimg.com/profile_images/281933747/kitamura_ava_normal.gif | |
description: Developer, Otaku, Geek. | |
urls: |
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
# Rake task to launch multiple Resque workers in development/production with simple management included | |
require 'resque/tasks' # Require Resque tasks | |
namespace :workers do | |
# = $ rake workers:start | |
# | |
# Launch multiple Resque workers with the Rails environment loaded, | |
# so they have access to your models, etc. |
OlderNewer