Skip to content

Instantly share code, notes, and snippets.

View jwrubel's full-sized avatar

James Wrubel jwrubel

View GitHub Profile
/*
* Adding contacts to a box
* This step takes the email addresses on the To: line of the email
*. and sends each one to the 'Add Contact To A Box In Streak' action
*. This needs to be executed in javascript because Streak's Zaps do
* not support line items (https://zapier.com/help/create/basics/use-line-items-in-zaps)
*. Author: Jim Wrubel (jwrubel@innovationworks.org)
*/
// Exclude internal staff who might be included on the email by filtering against
@jwrubel
jwrubel / iam_lambda_api_gateway_policy.json
Created December 14, 2018 17:25
IAM permissions for creating lambda and API gateway on AWS
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"apigateway:*"
],
"Resource": "arn:aws:apigateway:*::/*"
},
@jwrubel
jwrubel / base_file.png
Last active March 9, 2016 13:16
Using imagemagick caption: command to control text overlays on images
base_file.png
license_key: <%= Integer(ENV["DYNO"].rpartition('.').last) % 3 == 0 ? ENV["NEW_RELIC_LICENSE_KEY"] : ENV["NEW_RELIC_LITE_KEY"] %>
@jwrubel
jwrubel / scalr_newrelic_config
Created November 12, 2013 20:08
Configuring servers to register partial populations with New Relic in Scalr. We're using modulo three here force only 1/3 of the servers to report. Adjust this value based on your own environment. Assumes your Pro license key is stored in an environment variable named NEW_RELIC_LICENSE_KEY and Lite key is stored in NEW_RELIC_LITE_KEY.
license_key: <%= ENV["SCALR_INSTANCE_INDEX"] % 3 == 0 ? ENV["NEW_RELIC_LICENSE_KEY"] : ENV["NEW_RELIC_LITE_KEY"] %>
@jwrubel
jwrubel / gist:1986676
Created March 6, 2012 14:56
Full syntax for swf_tag with swfobject_rails
<%= swf_tag "name_of_swf", options={:dom_id => "dom_element",
:size => "320x240", :version => "10.1",
:flashvars => {"a" => "test"},
:params => {"menu" => "false", "wmode" => "direct"},
:attributes => {
"align" => "left",
"class" => "flash_css_class"
}
} %>
<div id="dom_element"></div>
@jwrubel
jwrubel / gist:1986681
Created March 6, 2012 14:57
swf_tag syntax in slim (should work for haml too)
= swf_tag "name_of_swf", \
options={:dom_id => "dom_element", \
:size => "320x240", :version => "10.1", \
:flashvars => {"a" => "test"}, \
:params => {"menu" => "false", "wmode" => "direct"}, \
:attributes => { "align" => "left", "class" => "flash_css_class" }}
div(id="dom_element")
@jwrubel
jwrubel / gist:ea5916c06efba6cd1e1e
Created October 6, 2014 18:49
removing clever schools that are not math
classes_to_86 = []
houston_schools = School.active.where(district_id: 1644)
houston_schools.each do |s|
s.classrooms.each do |c|
if (c.students.count == 0 && c.name.downcase.exclude?("math"))
c.deactivate!
end
end
end

Keybase proof

I hereby claim:

  • I am jwrubel on github.
  • I am jwrubel (https://keybase.io/jwrubel) on keybase.
  • I have a public key whose fingerprint is BB3D 86D5 7D33 94A3 9F83 5006 2078 2369 5373 72B5

To claim this, I am signing this object: