Skip to content

Instantly share code, notes, and snippets.

#define LIGHT_PIN 13
#define BUTTON_PIN 8
unsigned int lightState = LOW;
unsigned long toggleAt = 0;
unsigned long lastSwitch = 0;
defmodule MasterProxy.Proxy do
@moduledoc """
Simple plug to act as a proxy (for Heroku). It inspects the path and calls the appropriate endpoint.
"""
def init(options), do: options
def call(conn, _) do
if String.starts_with?(conn.request_path, "/admin") do
Admin.Endpoint.call(conn, [])
provider "aws" {
profile = "default"
region = "eu-west-1"
}
resource "aws_key_pair" "example" {
key_name = "examplekey"
public_key = file("~/.ssh/terraform.pub")
}
def read_from_car
p "I am reading stuff from the car. I will return the result."
# Or maybe I'll return nil if unsuccesful (or if there's an exception that's
# also fine but will need rescuing somewhere)
end
def send_stuff_to_cloud_kit(stuff)
p "sending the stuff to cloudkit: #{stuff}"
end
@paulanthonywilson
paulanthonywilson / funcs.el
Created January 26, 2018 13:59
Added to a Spacemacs layer to `mix format` on save
;;; Mostly nicked from https://github.com/jasongoodwin/emacs-elixir-formatter/blob/master/elixir-formatter.el
;;; I followed instructions from http://www.cultivatehq.com/posts/spacemacs-shared-config/ to add a Spacemacs
;;; layer, and just added this as a funcs.el file.
;;;
;;; (I still don't know what I'm doing.)
(defcustom
mix-location
"~/.asdf/shims/mix"

See http://www.erlang.org/doc/man/queue.html

A queue is modelled as a tuple with 2 lists.

iex(45)> q = :queue.new     
{[], []}

If you add to q queue, 1 item at a time, the right list will always contain the head and the left list the tail in reverse order.

Documentation:
Enabled: false
Style/FrozenStringLiteralComment:
Enabled: false
Metrics/BlockLength:
Exclude:
- 'spec/**/*'
Metrics/LineLength:
Max: 80
IgnoredPatterns: ['^\s*class\s']
Term Meaning
National newspaper English newspaper
Britain England
British English
The NHS NHS England
The North The North of England (just south of Scotland)
UK Riots in 2011 English Riots in 2011