Skip to content

Instantly share code, notes, and snippets.

@robmckinnon
robmckinnon / raspberry-pi-setup.sh
Last active October 3, 2019 13:38
raspberry pi buster setup
cp wpa_supplicant.conf /Volumes/boot/
touch ssh
cp ssh /Volumes/boot
ssh [email protected]
# raspberry
passwd
# new p/w
exit
ssh [email protected]
sudo raspi-config
@robmckinnon
robmckinnon / store
Last active October 24, 2018 10:33
store
{
"@id": "https://gist.github.com/robmckinnon/f6a2dcc02e98a66c74a50d7bc44e9c72/raw/store",
"@type": "Store",
"name": "Links Bike Shop",
"description": "The most \"linked\" bike store on earth!",
"product": [
{
"@id": "https://gist.githubusercontent.com/robmckinnon/f6f85a7708f24c3736de3ae4a93bd6ce/raw/links-swift-chain",
"@type": "Product",
"name": "Links Swift Chain",
@robmckinnon
robmckinnon / links-swift-chain
Last active October 24, 2018 10:29
links-swift-chain
@robmckinnon
robmckinnon / store.jsonld
Created October 24, 2018 10:09
store.jsonld
{
"@id": "http://store.example.com/",
"@type": "Store",
"name": "Links Bike Shop",
"description": "The most \"linked\" bike store on earth!",
"product": [
{
"@id": "p:links-swift-chain",
"@type": "Product",
"name": "Links Swift Chain",
@robmckinnon
robmckinnon / application.ex
Created April 10, 2018 22:16
Add GenServer implementation to supervision tree in application.ex
defmodule NodeProcess.Application do
# See https://hexdocs.pm/elixir/Application.html
# for more information on OTP Applications
@moduledoc false
use Application
def start(_type, _args) do
# List all child processes to be supervised
children = [
@robmckinnon
robmckinnon / wrapper.sh
Created April 10, 2018 21:59
Elixir 1.6 Port documentation recommends the use of a process wrapper script to prevent zombie processes.
#!/bin/sh
"$@" &
pid=$!
while read line ; do
echo line
done
kill -KILL $pid
@robmckinnon
robmckinnon / server.ex
Last active March 19, 2024 11:20
A GenServer implementation that starts a Node.js server process using Elixir ports.
defmodule NodeProcess.Server do
@moduledoc """
A GenServer implementation that starts a Node.js server process using Elixir ports.
"""
# Elixir automatically defines callbacks not overriden
use GenServer
@doc """
Called when application started via application.ex.
# Ambient Experiment
# Coded by Darin Wilson
#
# The piece consists of three long loops, each of which
# plays one of two randomly selected pitches. Each note
# has different attack, release and sleep values, so that
# they move in and out of phase with each other. This can
# play for quite awhile without repeating itself :)
{
"swagger": "2.0",
"info": {
"title": "Account and Transaction API Specification",
"description": "Swagger for Account and Transaction API Specification",
"termsOfService": "https://www.openbanking.org.uk/terms",
"contact": {
"name": "Service Desk",
"email": "[email protected]"
},
@robmckinnon
robmckinnon / register-country-and-territory-list.rb
Created December 8, 2016 11:06
Get sorted list of territory and country names excluding those with end_dates using Open Register Ruby client
require 'openregister-ruby'
c = OpenRegister.register('country', :beta)._all_records +
OpenRegister.register('territory', :alpha)._all_records
c.select{|x| x.end_date.blank?}.map(&:name).sort