This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.network :forwarded_port, guest: 3000, host: 3000 | |
config.vm.box = "precise" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'libxml' | |
module LibXML | |
module XML | |
module Conversions | |
module Document | |
def to_hash | |
root.to_hash | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ++++++++++---------- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.vagrant/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
require 'json' | |
module NewRelic | |
module Insights | |
class Query | |
attr_reader :key, :account_id | |
def initialize(key, account_id) |
-
Identify the steps in the high level process
eg.
- Step 1: Download CSV files from box
- Step 2: Convert CSV to JSON
- Step 3: Upload JSON and CSV files to S3
-
Create modules for each of those steps. In our use case, the top level process matches a pattern called "ETL" or "Extract, Transform, Load", so we used those names.
OlderNewer