require 'libxml' | |
module LibXML | |
module XML | |
module Conversions | |
module Document | |
def to_hash | |
root.to_hash | |
end | |
end |
# an example Monit configuration file for collectiveidea's fork of delayed_job. | |
# See: http://stackoverflow.com/questions/1226302/how-to-monitor-delayedjob-with-monit/1285611 | |
# | |
# To use: | |
# 1. replace {app_name} and {environment} as appropriate | |
# 2. copy to your repository under config/delayed_job.monitrc | |
# 3. add this to your /etc/monit/monitrc: | |
# | |
# include /var/www/apps/{app_name}/current/config/*.monitrc | |
# 4. reload monit when you deploy to pick up any changes to your monitrc files: sudo monit reload |
require "rubygems" | |
require "ffi" | |
module WinProcess | |
extend FFI::Library | |
ffi_lib "kernel32" | |
ffi_convention :stdcall | |
class Error < StandardError |
#!/custom/ree/bin/ruby | |
# USAGE: | |
# | |
# echo "|/path/to/core_helper.rb %p %s %u %g" > /proc/sys/kernel/core_pattern | |
# | |
require 'etc' | |
require 'net/smtp' |
From 36f25bf11b9e61b6361c829534dea2de0cf08acd Mon Sep 17 00:00:00 2001 | |
From: Chris Hapgood <cch1@hapgoods.com> | |
Date: Mon, 11 Oct 2010 09:42:05 -0400 | |
Subject: [PATCH] Let respond_to do the heavy action cache lifting | |
In determining the best content type for a response, let respond_to consider | |
available content types using existing logic. Work hard to ensure that | |
cached content has an extension to indicate its content type. | |
--- | |
.../lib/action_controller/caching/actions.rb | 73 ++++++++++---------- |
Gemfile.lock merge=bundlelock | |
db/schema.rb merge=railsschema |
# MySQL. Versions 4.1 and 5.0 are recommended. | |
# | |
# Install the MySQL driver: | |
# gem install mysql2 | |
# | |
# And be sure to use new-style password hashing: | |
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
development: | |
adapter: mysql2 | |
encoding: utf8 |
module ArelScopes | |
extend ActiveSupport::Concern | |
module ClassMethods | |
# Create chainable arel scopes | |
# Example: | |
# class Post | |
# arel_scope :published, lambda { arel_table[:published_at].gteq(Time.now) } | |
# arel_scope :written_by, lambda { |user| arel_table[:author_id].eq(user.id) } |
I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.
I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't real