Skip to content

Instantly share code, notes, and snippets.

View georgelesica-wf's full-sized avatar

George Lesica georgelesica-wf

View GitHub Profile
List<dynamic> _stuff = [];
void inject(dynamic thing) {
_stuff.add(thing);
}
T request<T>() => _stuff.firstWhere((thing) => thing is T, orElse: () => null);
class MyThing {
final String value = 'hello, world';
@georgelesica-wf
georgelesica-wf / about.md
Created July 18, 2017 19:13
A quick example of the visitor pattern using the Dart programming language.
@georgelesica-wf
georgelesica-wf / tags.sh
Last active April 20, 2017 21:07
Little shell script for automating switching between different Git tags in a presentation.
#!/usr/bin/env bash
set -e
CACHE_FILE="$HOME/.tags-cache"
if [ -f "$CACHE_FILE" ]; then
CURRENT_TAG=$(<"$CACHE_FILE")
else
unset CURRENT_TAG
@georgelesica-wf
georgelesica-wf / jvm
Last active March 15, 2016 02:37 — forked from tmlbl/jvm
JVM - Julia Version Manager
#!/usr/bin/env bash
# Switches between various Julia versions. By default, looks for versions in
# $HOME/local/julia/, but this can be configured by setting the JVM_BIN_PREFIX
# variable. Also links the corresponding packages directory to $HOME/julia-pkgs
# for convenience.
JVM_PKG_PREFIX=${JVM_PKG_PREFIX:-"$HOME/.julia"}
JVM_BIN_PREFIX=${JVM_BIN_PREFIX:-"$HOME/local/julia"}
module Landscape
data Landscape : Nat -> Nat -> Double -> Type where
NK : (n : Nat) -> (k : Nat) -> Landscape n k 0.0
NKp : (n : Nat) -> (k : Nat) -> (p : Float) -> Landscape n k p
getN : Landscape n _ _ -> Nat
getN _ = n
getK : Landscape _ k _ -> Nat