Skip to content

Instantly share code, notes, and snippets.

View ambuc's full-sized avatar

James Adam Buckland ambuc

View GitHub Profile
@ambuc
ambuc / fitter.py
Created October 20, 2021 03:07
Simulated Annealing demo
#!/usr/bin/python3
from PIL import Image
from scipy import optimize
from skimage import metrics
import cairo
import cv2
import numpy as np
import random
import scipy
import skimage
@ambuc
ambuc / .gitconfig
Last active May 31, 2021 21:10
.gitconfig
[user]
name = James Adam Buckland
email = james.adam.buckland@gmail.com
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit
graph = log --graph --oneline --decorate --all
st = status
br = branch
co = checkout
@ambuc
ambuc / config.fish
Last active May 31, 2021 21:08
~/.config/fish/config.fish
alias l='ls -CF'
alias ls='ls --color=auto'
alias tm='tmux new -A -s _'
alias blaze='bazel'
alias conda="~/anaconda3/condabin/conda"
alias gdl='cd ~/git'
if status --is-interactive
@ambuc
ambuc / .tmux.conf
Last active May 30, 2021 14:54
~/.tmux.conf
# :source-file ~/.tmux.conf
bind r source-file ~/.tmux.conf
# regular leader key
set -g prefix 'C-b'
bind-key 'C-b' send-prefix
set -g default-terminal "screen-256color"
set -sg escape-time 0 #Escape works without delay, important for Vim
@ambuc
ambuc / .vimrc
Last active May 31, 2021 18:50
.vimrc
" My ~/.vimrc.
" 2014 - present
" james.adam.buckland@gmail.com
"
" Notes
" * Activate fuzzy finder with ctrl-p.
" * After modifying plugins, call `:PluginInstall`.
" * Reload from Vimwith ":so %".
" * Try to keep it "literate".
package main
// Renders a series of julia_n.pngs which can be zipped together into a gif.
//
// Example usage:
// go run julia.go
// convert /tmp/julia*.png -loop 0 animation.gif
import (
"fmt"
@ambuc
ambuc / siteswap.hs
Last active October 13, 2018 04:32
import Control.Arrow ((&&&))
import Data.List (delete, elemIndices, nub, permutations, sort)
import Data.Random.Distribution.Normal
import System.Random
-- FAUX LIBRARIES --
intToDigit35 :: Int -> Char
intToDigit35 i
| i >= 0 && i <= 9 = toEnum (fromEnum '0' + i)
@ambuc
ambuc / 10-s.json
Last active September 5, 2018 19:59
example envoy --config-path <path> file
{
"staticResources": {
"listeners": [
{
"name": "listener0",
"address": {
"socketAddress": {
"address": "0.0.0.0",
"portValue": 26300
}
@ambuc
ambuc / 1.rs
Created December 28, 2017 23:33
use std::str;
fn main() {
let input_string = String::from("5228833336355848549915459366737982598312959583817455621545976784792489468198365998232722734876612332352376192813552949814275947575774339529811976644361517795586998319242241614813622734255797569571577699238592667287428166398221572885869416419682687759743978434571821267146514338394624525648338739929479912368172669885577319718389278168766844487948761697438722556857882433224393723131298876252626643517236883999115665656935521675772866516185899317132494716723615493476397115627687887665194781746377341468995954554518252916859227397693885254329628812355612487594445522395853551734567498838382248616137969637971369615443599973588326388792893969924855316437952313492551671545714262784738343517166544197194547173515155927244175447296474282154114951181648317875827525814453758846194548872789943372281952995222779173812444186491115426476188672253249744478946863317915136832199132868917891243591195719354721129116229164688256853628339233919671468781913167415624214152793
@ambuc
ambuc / irrev-cube-2.hs
Created September 2, 2017 15:03
Puzzle Pong - Irreversible Cube II
import Codec.Picture ( PixelRGBA8( .. ), writePng, Image)
import Control.Arrow (first,second,(***))
import Data.Function (on)
import Data.List (sort, nub, sortBy, groupBy, nubBy, delete, zip3, zip4, (\\))
import Data.List.Split (chunksOf)
import Data.Monoid ((<>))
import Data.Ord (comparing)
import Text.Printf
import Debug.Trace (trace)
import Cornea (Obj (..), World, mark, seenFrom, solid, render, isometric)