Skip to content

Instantly share code, notes, and snippets.

View ejhobbs's full-sized avatar

Edward Hobbs ejhobbs

  • Sustainability Monitor
  • Canterbury
View GitHub Profile
let l1 = ref 7
let l2 = ref 0
let l3 = ref 0
let l4 = ref 1
(* multiplies location l3 by l2, adds l4ult to l2es *)
let rec mult _ =
match !l2 >= 1 with
| true ->
l4 := !l4 + !l3;
#!/bin/sh
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
# merge in defaults and keymaps
if [ -f $sysresources ]; then
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
# For more information on configuration, see:
# * Official English Documentation: http://nginx.org/en/docs/
# * Official Russian Documentation: http://nginx.org/ru/docs/
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
# Load dynamic modules. See /usr/share/nginx/README.dynamic.
server {
listen 80;
server_name sonarr.ehobbs.it;
return 301 https://$host$request_uri;
}
server {
listen 443;
server_name sonarr.ehobbs.it;
PORT := /dev/ttyUSB0
MODEL := atmega328p
PROG := arduino
RATE := 115200
OUT := compiled
SOURCEDIR := .
SRC_FILES := $(shell find $(SOURCEDIR) -name '*.c')
OBJ_FILES=$(SRC_FILES:.c=.o)

Final year Project Ideas

WHAT

  • embedded
    • personal interest
  • functional
    • perfect fit since we want the same thing to always happen, for some given input state
    • can't be side-effect free, that doesn't make sense.
    • message passing
  • inbox - lump of memory per input?
apiWrapper.prototype.retry = (tries = 5, executor) => {
--tries;
return new Promise(executor)
.catch(err => {
if (tries >= 0) {
apiWrapper.prototype.retry(tries, executor)
} else {
Promise.reject(err)
}
})
test "do we get the correct value" do
stub = AdventOfCodeHelper.GetInputs
|> double
|> allow(:get_value, fn(_y,_d,session) -> {:ok, session} end)
{:ok, contents} = AdventOfCodeHelper.get_input(2015,1,stub)
assert contents == Application.get_env(:advent_of_code, :session)
assert_receive({:get_value, 2015, 1, nil})
end
defmodule AdventOfCodeHelper do
alias AdventOfCodeHelper.GetInputs
@moduledoc """
Provides an interface to get input values for Advent of Code puzzles
"""
def get_input(year, day \\ Date)
@doc """
Returns input values
## Parameters