Skip to content

Instantly share code, notes, and snippets.

James Wrubel jwrubel

Block or report user

Report or block jwrubel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jwrubel
jwrubel / iam_lambda_api_gateway_policy.json
Created Dec 14, 2018
IAM permissions for creating lambda and API gateway on AWS
View iam_lambda_api_gateway_policy.json
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"apigateway:*"
],
"Resource": "arn:aws:apigateway:*::/*"
},
@jwrubel
jwrubel / base_file.png
Last active Mar 9, 2016
Using imagemagick caption: command to control text overlays on images
@jwrubel
jwrubel / gist:ea5916c06efba6cd1e1e
Created Oct 6, 2014
removing clever schools that are not math
View gist:ea5916c06efba6cd1e1e
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
View keybase.md

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:

View heroku_newrelic_config.yml
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 Nov 12, 2013
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.
View scalr_newrelic_config
license_key: <%= ENV["SCALR_INSTANCE_INDEX"] % 3 == 0 ? ENV["NEW_RELIC_LICENSE_KEY"] : ENV["NEW_RELIC_LITE_KEY"] %>
@jwrubel
jwrubel / gist:1986681
Created Mar 6, 2012
swf_tag syntax in slim (should work for haml too)
View gist:1986681
= 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:1986676
Created Mar 6, 2012
Full syntax for swf_tag with swfobject_rails
View gist:1986676
<%= 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>
You can’t perform that action at this time.