As configured in my dotfiles.
start new:
tmux
start new with session name:
# -------------------------------------------- | |
# General | |
# -------------------------------------------- | |
set :shared_children, %w(cache logs) # Shared directories, these directories contain generated content which should not be wiped out during deployments. | |
set :application, "domain.com" # Application name | |
set :deploy_to, "/var/www/#{application}/#{stage}" # Path where files are deployed to ... | |
# -------------------------------------------- | |
# Server | |
# -------------------------------------------- |
# Import a posterous.com Blog into nanoc (http://nanoc.stoneship.org) | |
# Uses Nokogiri to parse the XML data from the posterous API | |
require 'rubygems' | |
require 'nanoc3' | |
require 'nokogiri' | |
require 'open-uri' | |
module Nanoc3::Extra | |
module Importers |
require 'rubygems' | |
require 'wpxml_parser' | |
require 'nanoc3' | |
require 'fileutils' | |
XML_PATH = 'data.xml' | |
NANOC_PATH = '.' | |
class WordpressNanocImporter | |
include WpxmlParser |
gem 'ruby_parser' | |
gem 'hpricot' | |
gem 'haml' |
[user] | |
name = Allen Madsen | |
email = [email protected] | |
[color] | |
diff = auto | |
status = auto | |
branch = auto | |
interactive = auto | |
ui = true | |
pager = true |
#!/usr/bin/env ruby -w | |
# brew-services(1) - Easily start and stop formulas via launchctl | |
# =============================================================== | |
# | |
# ## SYNOPSIS | |
# | |
# [<sudo>] `brew services` `list`<br> | |
# [<sudo>] `brew services` `restart` <formula><br> | |
# [<sudo>] `brew services` `start` <formula> [<plist>]<br> |
As configured in my dotfiles.
start new:
tmux
start new with session name:
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:
class ActiveRecord::Base | |
mattr_accessor :shared_connection | |
@@shared_connection = nil | |
def self.connection | |
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
end | |
end | |
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |