A proof of concept of having Sinatra like routes inside your controllers.
Since the router is gone, feel free to remove config/routes.rb
.
Then add the file below to lib/action_controller/inline_routes.rb
inside your app.
#!/bin/bash | |
echo "Generating an SSL private key to sign your certificate..." | |
openssl genrsa -des3 -out myssl.key 1024 | |
echo "Generating a Certificate Signing Request..." | |
openssl req -new -key myssl.key -out myssl.csr | |
echo "Removing passphrase from key (for nginx)..." | |
cp myssl.key myssl.key.org | |
openssl rsa -in myssl.key.org -out myssl.key |
if Rails.env.development? | |
Rails.application.assets.logger = Logger.new('/dev/null') | |
Rails::Rack::Logger.class_eval do | |
def call_with_quiet_assets(env) | |
previous_level = Rails.logger.level | |
Rails.logger.level = Logger::ERROR if env['PATH_INFO'] =~ %r{^/assets/} | |
call_without_quiet_assets(env) | |
ensure |
#!/usr/bin/env ruby | |
require 'time' | |
require 'erb' | |
require 'cgi' | |
filename = "~/.gitlogger" | |
## File format, One per line | |
# Repo Name:/path/to/base | |
dayone = false # log to day one? (true or false) | |
textlog = false # "~/Dropbox/nvALT2.2/GitLogger.md" # set to false to disable |
-export([graceful_stop/1, graceful_stop_proc/1]). | |
graceful_stop(Timeout) -> | |
lists:foreach(fun stop_listener/1, supervisor:which_children(cowboy_sup)), | |
proc_lib:spawn(?MODULE, graceful_stop_proc, [Timeout]). | |
graceful_stop_proc(Timeout) -> | |
true = register(graceful_stop, self()), | |
lager:critical("SHUTDOWN with timeout of ~p msec", [Timeout]), | |
TRef = erlang:start_timer(Timeout, self(), not_so_graceful), |
This playbook has been removed as it is now very outdated. |
<!doctype html> | |
<title>Site Maintenance</title> | |
<style> | |
body { text-align: center; padding: 150px; } | |
h1 { font-size: 50px; } | |
body { font: 20px Helvetica, sans-serif; color: #333; } | |
article { display: block; text-align: left; width: 650px; margin: 0 auto; } | |
a { color: #dc8100; text-decoration: none; } | |
a:hover { color: #333; text-decoration: none; } | |
</style> |
#!/usr/bin/env ruby | |
#^syntax detection | |
site 'http://community.opscode.com/api/v1' | |
cookbook 'apt', | |
:git=>'https://github.com/opscode-cookbooks/apt' | |
cookbook 'git', | |
:git=>'https://github.com/opscode-cookbooks/git' | |
cookbook 'build-essential', |
# Terminal Progress Indicators. Four examples are included: percentage, | |
# spinner, progress bar, and combined. This script has been tested on | |
# Mac OS X 10.8 with Ruby 1.8.7, 1.9.1, 1.9.2, and 1.9.3 | |
class Spinner | |
include Enumerable | |
def each | |
loop do | |
yield '|' | |
yield '/' |
#!/bin/bash | |
# | |
# This script configures WordPress file permissions based on recommendations | |
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions | |
# | |
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org> | |
# | |
WP_OWNER=www-data # <-- wordpress owner | |
WP_GROUP=www-data # <-- wordpress group | |
WP_ROOT=$1 # <-- wordpress root directory |