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
# OOOR: OpenObject On Ruby | |
# Copyright (C) 2009-2012 Akretion LTDA (<http://www.akretion.com>). | |
# Author: Raphaël Valyi | |
# Licensed under the MIT license, see MIT-LICENSE file | |
if ENV["CI"] | |
require 'coveralls' | |
Coveralls.wear! | |
end | |
require File.dirname(__FILE__) + '/../lib/ooor' |
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
gem 'sinatra' | |
group :development,:test do | |
gem 'rspec' | |
gem 'rack-test' | |
end |
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
SampleApp::Application.routes.draw do | |
resources :users | |
resources :sessions, only: [:new, :create, :destroy] | |
resources :events do | |
member do | |
get :members | |
end | |
collection do | |
get :search | |
end |
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
require 'restclient' | |
# RestClient logs using << which isn't supported by the Rails logger, | |
# so wrap it up with a little proxy object. | |
RestClient.log = | |
Object.new.tap do |proxy| | |
def proxy.<<(message) | |
Rails.logger.info message | |
end | |
end |
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
Warning: Your developer_dir setting in macports.conf points to a non-existing directory. Since this is known to cause problems, please correct the setting or comment it and let macports auto-discover the correct path. | |
xcode-select --print-path | |
sudo nano /opt/local/etc/macports/macports.conf |
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
# Chinese (China) translations for Devise(3.2.2) | |
# by Kenrick-Zhou (https://github.com/Kenrick-Zhou) | |
# https://gist.github.com/Kenrick-Zhou/7909822 | |
zh-CN: | |
devise: | |
confirmations: | |
confirmed: "您的帐号已经确认,您现在已登录。" | |
send_instructions: "几分钟后,您将收到确认帐号的电子邮件。" | |
send_paranoid_instructions: "如果您的邮箱存在于我们的数据库中,您将收到一封确认账号的邮件。" |
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
namespace :deploy do | |
desc "Hot-reload God configuration for the Resque worker" | |
task :reload_god_config do | |
sudo "god stop resque" | |
sudo "god load #{File.join(deploy_to, 'current', 'config', 'resque-' + rails_env + '.god')}" | |
sudo "god start resque" | |
end | |
end | |
# append to the bottom: |
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
# Paginate a collection | |
# | |
# Usage: | |
# | |
# {% paginate contents.projects by 5 %} | |
# {% for project in paginate.collection %} | |
# {{ project.name }} | |
# {% endfor %} | |
# {% endpaginate %} | |
# |
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
#!/usr/bin/env bash | |
# Simple move this file into your Rails `script` folder. Also make sure you `chmod +x puma.sh`. | |
# Please modify the CONSTANT variables to fit your configurations. | |
# The script will start with config set by $PUMA_CONFIG_FILE by default | |
PUMA_CONFIG_FILE=config/puma.rb | |
PUMA_PID_FILE=tmp/pids/puma.pid | |
PUMA_SOCKET=tmp/sockets/puma.sock |
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 | |
# | |
# nginx - this script starts and stops the nginx daemin | |
# | |
# chkconfig: - 85 15 | |
# description: Nginx is an HTTP(S) server, HTTP(S) reverse \ | |
# proxy and IMAP/POP3 proxy server | |
# processname: nginx | |
# config: /usr/local/nginx/conf/nginx.conf | |
# pidfile: /usr/local/nginx/logs/nginx.pid |
OlderNewer