Skip to content

Instantly share code, notes, and snippets.

View marceldegraaf's full-sized avatar

Marcel de Graaf marceldegraaf

View GitHub Profile
en_gb: &definitions
cake: lie
huge: success
en_us:
<<: *definitions
@marceldegraaf
marceldegraaf / gist:1316486
Created October 26, 2011 14:16
Pull disruptions from the NS (Dutch Railways) API and send them to Campfire
# A way to interact with the NS (Dutch Railways) API
#
# To configure, add NS_API_EMAIL and NS_API_PASSWORD to your Heroku config with "heroku config:add"
#
# train disruptions <station> - Retrieve the list of disruptions near <station>.
# Please note: <station> can be a station code (e.g. 'asd')
# or (part of) a station name (e.g. 'Amsterdam Centraal')
#
disruptionPageRoot = 'http://www.ns.nl/storingen/index.form#'
module.exports = (robot) ->
@marceldegraaf
marceldegraaf / deploy.rb
Created September 14, 2012 17:11
Only run assets:precompile when assets have been changed
namespace :deploy do
namespace :assets do
task :precompile, :roles => :web, :except => { :no_release => true } do
precompile_command = %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
if remote_file_exists?("#{current_path}/REVISION")
from = source.next_revision(current_revision)
if capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
run precompile_command
else
@marceldegraaf
marceldegraaf / attributes-default.rb
Created November 28, 2012 11:40
Chef monit cookbook
default[:monit][:alert_emails] = %w( root@localhost )
default[:monit][:logfile] = "/var/log/monit.log"
default[:monit][:alert_from] = "monit@localhost"
default[:monit][:remote_user] = 'admin'
default[:monit][:remote_password] = 'secret'
@marceldegraaf
marceldegraaf / attributes-default.rb
Created January 24, 2013 11:44
Chef recipe to add Newrelic's server monitoring daemon to your Ubuntu instances.
default[:newrelic][:apt_repo_key] = '548C16BF'
default[:newrelic][:license] = 'your-key'
default[:newrelic][:log_level] = 'info'
default[:newrelic][:log_file] = '/var/log/newrelic/nrsysmond.log'
default[:newrelic][:proxy] = nil
default[:newrelic][:ssl] = nil
default[:newrelic][:ssl_ca_bundle] = nil
default[:newrelic][:ssl_ca_path] = nil
default[:newrelic][:pidfile] = "/var/run/nrsysmond.pid"
default[:newrelic][:collector_host] = nil
@marceldegraaf
marceldegraaf / _form.emblem
Last active December 17, 2015 03:28
Saving a model from Ember.js
hr
form
p
label Name
Ember.TextField valueBinding=name
p
label Email
Ember.TextField valueBinding=email
@marceldegraaf
marceldegraaf / bar_controller.coffee
Created July 10, 2013 10:04
Ember "needs" in namespaced controllers
App.Namespace.BarController = Ember.Controller.extend
needs: [ 'foo' ] # <= this raises a "missing dependencies" exception
machine git.hostname.com
login johndoe
password supersecret
@marceldegraaf
marceldegraaf / id_rsa.pub
Created May 30, 2016 08:41
My public SSH key
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxv/dE1AR8qiFciEc2lEKwYvTNbASElepSoRslxfLaq7eeQL5V3/hY+2XzG5RAQqgqKYQJIEpGHHoKT6wQtagAcGTKtij7HMslIeFMhtWc3TJIi7LkLxZQ/KIq8ONDtb+wKA1mJiE/hCX7Fgm6LiHn3FKfoVf4bnEBmKz76O6wCZNexjHxFU7F2Vh/KzhHYvYpPN/l7lSwywp4j1/V1i01OhgTKvDrJ94jmjZGQaOsQ06v4d0zsqidIWot/fzdIypKsaiP7TyVcDcqAZjdK7HVNOa1bmGzwE5Hasnm/veLT/Fl8/2Ds9eeBKkEqDFNg9V1JjwQNbeDgp70dVDxLpZmw== marcel@MarBook.local
@marceldegraaf
marceldegraaf / keybase.md
Created August 16, 2016 08:28
keybase.md

Keybase proof

I hereby claim:

  • I am marceldegraaf on github.
  • I am marceldegraaf (https://keybase.io/marceldegraaf) on keybase.
  • I have a public key ASCeat4f1NH0BL70IEAunSmSxb-JsRp-KQlE-QzzhI8XgAo

To claim this, I am signing this object: