Skip to content

Instantly share code, notes, and snippets.

View marceldegraaf's full-sized avatar

Marcel de Graaf marceldegraaf

View GitHub Profile
@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 / 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
@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