Skip to content

Instantly share code, notes, and snippets.

View bukzor's full-sized avatar
🌥️
learning google cloud

Buck Evan bukzor

🌥️
learning google cloud
  • google.com
  • Appleton, WI
  • 00:46 (UTC -05:00)
View GitHub Profile
@bukzor
bukzor / formality.md
Last active August 14, 2020 11:32
Figuring out type definitions in Formality lang. https://github.com/moonad/Formality

Type definition

T Color.
| Red.;
| Blue.;

Desugars to:

@bukzor
bukzor / .fm
Created August 9, 2020 22:18
The simple Formality proofs. https://github.com/moonad/Formality/
T False
T True
| true;
Not(A: Type): Type
A -> False
T Equal<A: Type> ~ (a: A, b: A)
| same<a: A> ~ (a, a);
$ cat head2.fm
head2.IO.readline(_: Unit): IO(String)
use line = IO.ask<String>("get_line", "")
IO.end<String>(line)
head2: IO(Unit)
get bind pure = IO.monad
let io0 = pure<>(Unit.new)
let io1 = bind<,>(io0, head2.IO.readline)
@bukzor
bukzor / example.log
Created August 3, 2020 01:27
"The.value" typeerror, but values seem to match.
$ cat example.fm
example.3.0 : _
pythonic.str.split("", "abc")
example.3.1 : _
["a", "b", "c"]
example.3.test: The(_, example.3.1)
The.value<>(example.3.0)
$ head head.fm
head.splitc(c: Char, xs: List(Char)): List(List(Char))
case xs:
| nil => List.nil<List(Char)>;
| cons => if U16.eql(xs.head, c)
then List.cons<>(c, head.splitc(c, xs.tail))
else head.splitc(c, xs.tail);
head.splitc_example3 : _
head.splitc('x', ['a', 'x', 'b'])
head.splitc_example3 : The(List(List(Char)), head.splitc('x', ['a', 'x', 'b']))
The.value<List(List(Char))>([['a'], ['b']])
Inside head.splitc_example3:
Found type... The(List(List(Char)),List.cons(List.cons('a',List.nil),List.cons(List.cons('b',List.nil),List.nil)))
Instead of... The(List(List(Char)),head.splitc('x',List.cons('a',List.cons('x',List.cons('b',List.nil)))))
On line 19:
18| head.splitc_example3 : The(List(List(Char)), head.splitc('x', ['a','x', 'b']))
19| The.value<List(List(Char))>([['a'], ['b']])
from __future__ import print_function
import contextlib
import pytest
# Introduce a Loud integer class that has some annoying properties that force us into a bunch of
# set up in our tests (in this case, to prevent unnecessary output to stdout during test)
class LoudInt(int):
@bukzor
bukzor / crash.log
Created March 31, 2019 21:03
terraform crash while updating google_compute_url_map
$ tf plan -out tfplan && tf apply tfplan ; alert "Terraformed! (0)"
GoSM: Setting up security policy for terraform binary.GoSM: Setting up security policy for terraform binary.
Warning: module.global.module.restricted-area--unrestricted.module.continent--asia.module.gke.data.google_container_engine_versions._: "region": [DEPRECATED] Use location instead
Warning: module.global.module.restricted-area--unrestricted.module.continent--asia.module.gke.module.nodepool--batch--f1-micro.google_container_node_pool._: "region": [DEPRECATED] use location instead
@bukzor
bukzor / colortest16777216
Created August 22, 2018 20:58
A simple way to tell if your terminal supports truecolor.
$ cat ~/bin/colortest16777216
#!/usr/bin/env python3
# pylint: disable=g-import-not-at-top,missing-docstring,g-wrong-blank-lines
from collections import namedtuple
class Color(namedtuple('Color', 'r g b')):
"""values are 0 to 1"""
@classmethod
$ brew config
HOMEBREW_VERSION: 1.6.3-dirty
ORIGIN: [email protected]:Linuxbrew/brew.git
HEAD: b67917c837f1fb9c5bf2494cfd89b4eee6802802
Last commit: 6 hours ago
Core tap ORIGIN: https://github.com/Linuxbrew/homebrew-core
Core tap HEAD: 968e12cee4398a031dc80eef3f2cde5bb656ad81
Core tap last commit: 3 hours ago
HOMEBREW_PREFIX: /home/buck/prefix/brew
HOMEBREW_REPOSITORY: /home/buck/prefix/brew