Replace in your config/application.rb
require "rails/all"with:
require "rails"| # Nginx+Unicorn best-practices congifuration guide. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
| #!/usr/bin/env perl | |
| my $array = [qw/one two/]; | |
| my $hash = {}; | |
| my $value = [qw/done and done/]; | |
| sub head { | |
| my (@list) = @_; | |
| return shift @list; | |
| } |
| sub reduce (&;$@) { | |
| my $code = shift; | |
| my $f = sub { | |
| my $base_val = shift; | |
| my $g = sub { | |
| my $val = $base_val; | |
| for (@_) { | |
| local ( $a, $b ) = ( $val, $_ ); | |
| $val = $code->( $val, $_ ); | |
| } |
| #!/usr/bin/perl | |
| use strict; | |
| use warnings; | |
| use Test::More tests => 13; | |
| ## ---------------------------------------------------------------------------- | |
| ## Mini Meta-Model with Self-Bootstrapping Roles | |
| ## ---------------------------------------------------------------------------- |
| #!/usr/bin/perl -w | |
| use strict; | |
| use warnings; | |
| { | |
| package DEEP; | |
| sub deeply { "deeply inherited" } | |
| package UNIVERSAL; |
| a = {candidate: "candidate1", weight: 1} | |
| b = {candidate: "candidate1", weight: 1} | |
| c = {candidate: "candidate2", weight: 1} | |
| v = [a, b, c].group_by { |x| x[:candidate] }.map { |k,v| { k => v.inject(0) {|a, h| a + h[:weight]}}} | |
| # => [{"candidate1"=>2}, {"candidate2"=>1}] | |
| h = v.each_with_object({}) { |c,hash| | |
| c.each_pair {|k,v| |
| # See http://www.ruby-doc.org/core-1.9.3/Kernel.html#method-i-set_trace_func for docs on this function | |
| require 'ostruct' | |
| module Friendly | |
| def self.included(base) | |
| base.extend(ClassMethods) | |
| end | |
| def method_missing(name, *args, &block) |
| require "awesome_print" | |
| AwesomePrint.irb! |
| ;; emacs configuration | |
| (add-to-list 'load-path "~/.emacs.d/el-get/el-get") | |
| (unless (require 'el-get nil 'noerror) | |
| (with-current-buffer | |
| (url-retrieve-synchronously | |
| "https://raw.github.com/dimitri/el-get/master/el-get-install.el") | |
| (let (el-get-master-branch) | |
| (goto-char (point-max)) |