Skip to content

Instantly share code, notes, and snippets.

View moreta's full-sized avatar

JungJoo Seo moreta

  • Brakio
  • Japan
View GitHub Profile
;; Copyright (C) 2007,2008,2009,2010 Hiroki Yagita.
;; ポリシー ----------------------------------------------------------
;; - meadow は捨てました
;; - xemacs は捨てました
;; - なるべくどこでも動くようにしたい
;; - 初期化スクリプトは ~/.emacs.d/init.el にしています
;; - ~/.emacs.d/ の下に分離スクリプトやデータを置くことがあります(それ以外の場所に置かない)
@mrrooijen
mrrooijen / Capistrano-Deployment-Recipe.rb
Created July 29, 2009 09:34
a "base" Capistrano Rails Deployment Recipe. Use it to deploy your Rails application. It is also easily expandable. So feel free to grab this Recipe and add your own tasks/customization!
# Guide
# Configure the essential configurations below and do the following:
#
# Repository Creation:
# cap deploy:repository:create
# git add .
# git commit -am "initial commit"
# git push origin master
#
# Initial Deployment:
@ecpplus
ecpplus / production.rb
Created November 21, 2010 17:56
Nginx X-Accel-Redirect with Rails
# Only for Rails3
# config.action_dispatch.x_sendfile_header = 'X-Sendfile'
config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect'
@presidentbeef
presidentbeef / rubychat.rb
Created January 6, 2011 08:02
Simple Ruby chat with GServer
require 'gserver'
class ChatServer < GServer
def initialize *args
super
#Keep a list for broadcasting messages
@chatters = []
#We'll need this for thread safety
class CreatePdmRevisions < ActiveRecord::Migration
def self.up
create_table :pdm_revisions do |t|
t.column :commit_message, :string
t.column :attachment, :string
t.column :created_by, :string
t.column :created_date, :datetime
t.column :document_type, :string
t.column :pdm_document_id, :int
end
@matpowel
matpowel / tableless.rb
Created July 23, 2011 10:04
An ActiveRecord emulating Tableless model which works with Rails 3.1
class Tableless < ActiveRecord::Base
def self.column(name, sql_type = nil, default = nil, null = true)
columns << ActiveRecord::ConnectionAdapters::Column.new( name.to_s, default, sql_type.to_s, null )
end
def self.columns()
@columns ||= [];
end
@simi
simi / rails.rb
Created October 17, 2011 12:59
Rails 3.1.1 Webrick with SSL support
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
require 'rubygems'
require 'rails/commands/server'
require 'rack'
require 'webrick'
require 'webrick/https'
module Rails
@cblunt
cblunt / Gemfile
Created October 21, 2011 08:55
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@devpuppy
devpuppy / nokogiri libxml homebrew lion
Created November 8, 2011 23:26
How to fix: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
FIXME:
WARNING: Nokogiri was built against LibXML version 2.7.3, but has dynamically loaded 2.7.8
or
libxml_ruby.bundle: dlsym(0x10fde1900, Init_libxml_ruby): symbol not found
gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
@diegueus9
diegueus9 / pg2mysql.py
Created December 15, 2011 22:49
Python script for migrate database from postgres to mysql
#! /usr/bin/env python
import os
import psycopg2
import MySQLdb
PG = {
'name' : 'moodle_rvt_sociales',
'user' : 'diegueus9',
'pass' : 'fuseki',
'host' : 'localhost',