Skip to content

Instantly share code, notes, and snippets.

View monkeygroover's full-sized avatar

Richard Bowker monkeygroover

View GitHub Profile
@monkeygroover
monkeygroover / bbc.basic
Created February 13, 2020 13:13
Dragon curve
10 MODE1: VDU23;8202;0;0;0; :M=9
20 DIM S(7),C(7)
30 FOR T=0 TO 7:S(T)=SIN(T*PI/4):C(T)=COS(T*PI/4):NEXT
40 MOVE 180,600
50 PROCDRAW(792,0,-1)
60 END
1000 DEF PROCDRAW(L,I,T)
1010 IF L<M THEN PLOT 1,L*C(I),L*S(I):ENDPROC
1020 L=L/1.414
1030 PROCDRAW(L,(I+T)AND7,1)
@monkeygroover
monkeygroover / hob.jpg
Last active January 15, 2020 13:31
Hob sensor
hob.jpg
@monkeygroover
monkeygroover / rust.md
Created May 14, 2019 08:22
Rust notes

When updating nightly, sometimes it fails, check here for last good build

rustup components history

Then install it with

rustup toolchain install

set default with

@monkeygroover
monkeygroover / setup.md
Last active December 28, 2019 13:39
Chromebook container setup
  • install container

  • sudo apt install fish tmux

  • sudo chsh <username>

    • /usr/bin/fish
  • curl -L https://get.oh-my.fish | fish

    • omf install bobthefish
@monkeygroover
monkeygroover / part1-1.clj
Created February 2, 2019 19:44
advent_of_code 1.1
#!/usr/bin/env lein exec
(print (reduce + (map read-string (line-seq (java.io.BufferedReader. *in*)))))
@monkeygroover
monkeygroover / part1.exs
Last active February 2, 2019 19:31
advent_of_code 1.1
#! /usr/bin/env elixir
IO.stream(:stdio, :line)
|> Stream.map(&String.trim/1)
|> Stream.map(&String.to_integer/1)
|> Enum.sum
|> IO.inspect
@monkeygroover
monkeygroover / consul.clj
Created September 16, 2018 16:15
read consul nodes and addresses
(reduce conj {} (map #(let [{node "Node" address "Address"} %] {address node})
(json/read-str (slurp "http://localhost:8500/v1/catalog/nodes"))))
@monkeygroover
monkeygroover / hiccup_example.clj
Created September 7, 2018 10:50
hiccup templating
(ns confluence-version-page-generator.table)
(require '[hiccup.core :refer [html]])
(defn render [table-data]
(html [:table
[:tr
[:th "Service"]
[:th "SHA(s)"]
[:th "Nodes"]]
(for [{service "service" versions "versions"} table-data]
[:tr
defmodule TableRenderer do
def render_html(service_data) do
markup = """
table
tr
th Service
th SHA(s)
th Nodes
= Enum.map service_data, fn({service, data}) ->
/**
* Copyright 2011-2017 GatlingCorp (http://gatling.io)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software