Skip to content

Instantly share code, notes, and snippets.

View marceldegraaf's full-sized avatar

Marcel de Graaf marceldegraaf

View GitHub Profile
@marceldegraaf
marceldegraaf / home-assistant.yaml
Created January 7, 2023 12:37
Home Assistant and Homebridge Setup
version: "3"
services:
home-assistant:
container_name: home-assistant
image: ghcr.io/home-assistant/home-assistant:stable
volumes:
- '/home/homeassistant/config:/config'
- '/etc/localtime:/etc/localtime:ro'
environment:
- TZ=Europe/Amsterdam
@marceldegraaf
marceldegraaf / profile.txt
Created February 6, 2018 09:54
Profile of Cldr.DateTime.to_string
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]
@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:

@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 / service.ex
Created March 1, 2016 11:41
Using UUID as primary key in Phoenix (with PostgreSQL)
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

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 July 10, 2013 10:04
Ember "needs" in namespaced controllers
App.Namespace.BarController = Ember.Controller.extend
needs: [ 'foo' ] # <= this raises a "missing dependencies" exception
@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 / 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 / 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'