By default RAILS_RELATIVE_URL_ROOT
is used only for asset pipeline.
To namespace your rails routes you need to wrap run MyApp::Application
with map
in your config.ru:
map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
#!/usr/bin/env ruby | |
# -*- coding: utf-8 -*- | |
# 有关 Fiber 的解释: (按照数据流的方向分为两部分) | |
# 在 `主线程' 中使用 resume 方法来启动(或继续执行)一个 `纤程'. | |
# 1. 第一次调用 fiber.resume, 会启动一个纤程, | |
# 如果 resume 调用时提供了实参, 会作为代码块形参传入代码块. | |
# 2. 如果非第一次调用 fiber.resume, 即, `恢复' 一个纤程, 会做两件事: | |
# - 从上次离开纤程的那个位置(调用 Fiber.yield 离开纤程的那个位置), 恢复纤程的执行. |
#!/bin/bash | |
################################################################################## | |
# 1 - Create the base container | |
SUITE=squeeze | |
RELEASE=$SUITE | |
sudo lxc-create -n ${RELEASE}-base -t debian | |
rootfs="/var/lib/lxc/${RELEASE}-base/rootfs" |
#!/usr/bin/ruby | |
require 'socket' | |
# From bits/ioctls.h | |
SIOCGIFNETMASK = 0x891b # Netmask address | |
SIOCGIFHWADDR = 0x8927 # hardware address | |
SIOCGIFADDR = 0x8915 # PA address | |
SIOCGIFCONF = 0x8912 # iface list |
require 'msgpack' | |
require 'thread' | |
class ProcessPool | |
def initialize(num_process, args={}) | |
queue_size, worker_class = parse_args([ | |
:queue_size, nil, | |
:worker_class, Worker, | |
], args) |
Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.
As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.
Here's how to get it set up on Mac OS X:
OpenConnect can be installed via homebrew:
brew update
brew install openconnect
Dear Rubyists,
I just lost a contract because of my code in a Rails project.
The specific code in question is related to a "posting a comment" feature. Here are the details:
In this project, "posting a comment" does not simply entail inserting a row into the database. It involves a procedure to yes, insert a row, but also detect its language, check for spam, send emails, and "share" it to Twitter and Facebook. I believe this algorithm should be encapsulated. I do not believe it belongs in a controller or a model. I do not believe Active Record callbacks should be used.
The "senior developer", whom is the stake holder's right hand man, said this:
load 'rake/helper.rb' | |
desc "Set up the VM" | |
task :up do | |
vm = VM.new | |
vm.cli('up') | |
end | |
desc "Shutdown the VM" | |
task :graceful_down do |