Skip to content

Instantly share code, notes, and snippets.

Marcel de Graaf marceldegraaf

Block or report user

Report or block marceldegraaf

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
@marceldegraaf
marceldegraaf / profile.txt
Created Feb 6, 2018
Profile of Cldr.DateTime.to_string
View profile.txt
FUNCTION CALLS % TIME [uS / CALLS]
-------- ----- ------- ---- [----------]
otp_internal:obsolete/3 2 0.00 0 [ 0.00]
erl_internal:new_type_test/2 1 0.00 0 [ 0.00]
lists:duplicate/3 2 0.00 0 [ 0.00]
lists:merge/1 1 0.00 0 [ 0.00]
lists:rmergel/2 1 0.00 0 [ 0.00]
lists:merge2_1/4 1 0.00 0 [ 0.00]
erl_bits:apply_defaults/5 5 0.00 0 [ 0.00]
erl_lint:pattern_map/5 1 0.00 0 [ 0.00]
View 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:

View id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAxv/dE1AR8qiFciEc2lEKwYvTNbASElepSoRslxfLaq7eeQL5V3/hY+2XzG5RAQqgqKYQJIEpGHHoKT6wQtagAcGTKtij7HMslIeFMhtWc3TJIi7LkLxZQ/KIq8ONDtb+wKA1mJiE/hCX7Fgm6LiHn3FKfoVf4bnEBmKz76O6wCZNexjHxFU7F2Vh/KzhHYvYpPN/l7lSwywp4j1/V1i01OhgTKvDrJ94jmjZGQaOsQ06v4d0zsqidIWot/fzdIypKsaiP7TyVcDcqAZjdK7HVNOa1bmGzwE5Hasnm/veLT/Fl8/2Ds9eeBKkEqDFNg9V1JjwQNbeDgp70dVDxLpZmw== marcel@MarBook.local
@marceldegraaf
marceldegraaf / service.ex
Created Mar 1, 2016
Using UUID as primary key in Phoenix (with PostgreSQL)
View service.ex
defmodule YourApp.Service do
use YourApp.Web, :model
@primary_key {:id, :binary_id, autogenerate: true}
schema "services" do
field :name, :string
field :description, :string
timestamps
View 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 whose fingerprint is 9AAD 470A 6401 CFA5 766C AB44 E1A1 A830 6125 FB59

To claim this, I am signing this object:

@marceldegraaf
marceldegraaf / bar_controller.coffee
Created Jul 10, 2013
Ember "needs" in namespaced controllers
View bar_controller.coffee
App.Namespace.BarController = Ember.Controller.extend
needs: [ 'foo' ] # <= this raises a "missing dependencies" exception
@marceldegraaf
marceldegraaf / _form.emblem
Last active Dec 17, 2015
Saving a model from Ember.js
View _form.emblem
hr
form
p
label Name
Ember.TextField valueBinding=name
p
label Email
Ember.TextField valueBinding=email
@marceldegraaf
marceldegraaf / attributes-default.rb
Created Jan 24, 2013
Chef recipe to add Newrelic's server monitoring daemon to your Ubuntu instances.
View attributes-default.rb
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
View attributes-default.rb
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 / deploy.rb
Created Sep 14, 2012
Only run assets:precompile when assets have been changed
View deploy.rb
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
You can’t perform that action at this time.