Skip to content

Instantly share code, notes, and snippets.

@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 February 18, 2024 22:49
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');
@endymion
endymion / gist:2286052
Created April 2, 2012 18:24
Media queries for tablet/phone landscape/portrait
HTML:
<meta name='viewport' content='width=device-width'>
CSS:
/* phone portrait */
@media only screen and (max-width: 320px) and (orientation: portrait) {
}