Skip to content

Instantly share code, notes, and snippets.

@endymion
endymion / gist:8588110
Created January 23, 2014 22:28
Somebody probed a staging server, the moment that I mapped a DNS name to it.
Processing ApplicationController#index (for 93.174.93.17 at 2014-01-23 22:04:45) [GET]
ActionController::RoutingError (No route matches "/cgi-bin/php" with {:method=>:get}):
sass (3.1.21) rails/./lib/sass/plugin/rack.rb:54:in `call'
sass (3.1.21) rails/./lib/sass/plugin/rack.rb:54:in `call'
/data/venuedriver/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.6.2.96/lib/new_relic/rack/agent_hooks.rb:18:in `call'
/data/venuedriver/shared/bundled_gems/ruby/1.8/gems/newrelic_rpm-3.6.2.96/lib/new_relic/rack/browser_monitoring.rb:16:in `call'
/usr/libexec/passenger/lib/phusion_passenger/rack/request_handler.rb:97:in `process_request'
/usr/libexec/passenger/lib/phusion_passenger/abstract_request_handler.rb:520:in `accept_and_process_next_request'
@endymion
endymion / R_I_Item.txt
Created November 14, 2013 04:38
Redacted evil data.
I,1,TEST,106
I,15001,Food item,10
I,15002,Food item,10
I,15003,Food item,10
I,15004,Food item,10
I,15005,Food item,10
I,15006,Food item,10
I,15007,Food item,10
I,15008,Food item,10
I,15009,Food item,10
@endymion
endymion / R_I_Item.txt
Created November 14, 2013 04:38
EVIL DATA!
"I",1,"TEST",106
"I",15001,"Beer - Domestic - Rolling Rock",10
"I",15002,"Beer - Domestic - Bud",10
"I",15003,"Beer - Domestic - Bud Light",10
"I",15004,"Beer - Domestic - Coors Light",10
"I",15005,"Beer - Domestic - Miller Genuine Draft",10
"I",15006,"Beer - Domestic - Miller Lite",10
"I",15007,"Beer - Domestic - O'Douls",10
"I",15008,"Beer - Domestic - Sierra Nevada",10
"I",15009,"Beer - Domestic - Sam Adams Boston Lager",10
@endymion
endymion / gist:7432783
Created November 12, 2013 15:29
Manual control over Engine Yard environment alerts by configuring collectd with custom Chef recipes
if node[:name] && node[:name].downcase =~ /resque/
collectd do
load :warning => 20, :failure => 30
end
end
if node[:name] && node[:name].downcase =~ /cron/
collectd do
load :warning => 15, :failure => 20
end
@endymion
endymion / contact.rb
Last active May 6, 2025 00:21
Example of integrating a Ruby on Rails app with Zapier using the REST hooks pattern. With support for triggering the REST hooks from Resque background jobs.
class Contact < ActiveRecord::Base
...
def after_create
if Hook.hooks_exist?('new_contact', self)
Resque.enqueue(Hook, self.class.name, self.id)
# To trigger directly without Resque: Hook.trigger('new_contact', self)
end
end
@endymion
endymion / gist:5578012
Created May 14, 2013 17:53
That's just cool, admit it.
(rdb:487) p @start_date
Sat, 13 Apr 2013
(rdb:487) p (@start_date..@end_date).to_a
[Sat, 13 Apr 2013, Sun, 14 Apr 2013, Mon, 15 Apr 2013, Tue, 16 Apr 2013, Wed, 17 Apr 2013, Thu, 18 Apr 2013, Fri, 19 Apr 2013, Sat, 20 Apr 2013, Sun, 21 Apr 2013, Mon, 22 Apr 2013, Tue, 23 Apr 2013, Wed, 24 Apr 2013, Thu, 25 Apr 2013, Fri, 26 Apr 2013, Sat, 27 Apr 2013, Sun, 28 Apr 2013, Mon, 29 Apr 2013, Tue, 30 Apr 2013, Wed, 01 May 2013]
@endymion
endymion / README.md
Last active December 10, 2015 10:48 — forked from mbostock/.block

This stacked bar chart is constructed from a CSV file storing the populations of different states by age group. The chart employs conventional margins and a number of D3 features:

@endymion
endymion / gist:3437745
Created August 23, 2012 15:27
Example of how to post an update to a Guest record using the API.
def test_api_update_guest
post :create, @authentication.merge(
'guest' => {
'event' => @event.id,
'account' => @account.id,
'first' => 'Testy',
'last' => 'Testerson',
'phone' => '555 555-5555',
'email' => 'test@test.com',
}
<form id="wr" name="waitroomform" action="" method="POST">
<input type="hidden" name="hudValue" value="2f2923f3c15c844d4ad7352d919ebef3">
<input type="hidden" name="__wr" value="1">
</form>
<SCRIPT language="JavaScript">
function submitWait() {
setTimeout('submitForm()',30000);
<?php
$structure = sys_get_temp_dir().'/bla';
if (is_dir($structure)) {
echo ('Directory exists: ' . $structure);
}
else {
if (!mkdir($structure, 0, true)) {
die('Failed');