Skip to content

Instantly share code, notes, and snippets.

View carimura's full-sized avatar

Chad Arimura carimura

  • San Francisco, CA
View GitHub Profile
worker_client.schedules.create('SendInsanity',
{
:number => number,
:config => worker_client.api.options
},
{
:start_at => Time.now,
:run_times => 5,
:run_every => 60
})
@carimura
carimura / gist:3120905
Created July 16, 2012 05:51
Worker Callback URL
https://worker-aws-us-east-1.iron.io/2/projects/{PROJECT_ID}/tasks/webhook?code_name=TwilioWebhook&oauth={TOKEN}
@carimura
carimura / iron.json
Created June 11, 2012 19:52
workers/.iron.json
{
"token":"YOUR_TOKEN",
"project_id":"YOUR_PROJECT_ID"
}
@carimura
carimura / settings.yml
Created June 11, 2012 19:48
config/settings.yml
sendgrid:
address: "smtp.sendgrid.net"
port: '25'
authentication: :plain
domain:
user_name:
password:
@carimura
carimura / iron_mailer.rb
Created June 11, 2012 19:42
workers/iron_mailer.rb
# We included ActionMailer and our mailer models in the code package
# in the last step, but we still need to require them in our worker file.
require 'active_support/core_ext'
require 'action_mailer'
require 'models/mailer'
# Parse our config yaml file
config = YAML.load_file("settings.yml")
# A nifty Ruby line to set the AM settings from our loaded yaml file
@carimura
carimura / iron_mailer.worker
Created June 11, 2012 19:36
workers/iron_mailer.worker
runtime "ruby"
# Naming our worker (this is an arbitrary string, we like camelcasing)
name "IronMailer"
# The actual worker file to execute
exec "iron_mailer.rb"
# Merging all of our Rails apps models
dir '../app/models'
@carimura
carimura / hello_world.html.erb
Created June 11, 2012 19:28
app/views/mailer/hello_world.html.erb
Hello from Iron.io!
@carimura
carimura / email.html.erb
Created June 11, 2012 19:27
app/views/layouts/email.html.erb
<!DOCTYPE html>
<html>
<head><title></title></head>
<body>
<%= yield %>
</body>
</html>
@carimura
carimura / mailer.rb
Created June 11, 2012 19:25
app/models/mailer.rb
class Mailer < ActionMailer::Base
layout 'email'
default :from => "[email protected]"
def hello_world(email)
mail(:to => email,
:subject => "Hello World from IronWorker!")
end
end
IronMQ::Client.new(:host => 'rackspace')
IronMQ::Client.new(:host => 'aws')
IronMQ::Client.new(:host => 'my_private_cloud')