Skip to content

Instantly share code, notes, and snippets.

View apg's full-sized avatar
🐢
Turtle

Andrew Gwozdziewycz apg

🐢
Turtle
View GitHub Profile
"""
This is a reference implementation for the proposed datetime RFC
for the Cedar Policy Language. The RFC is currently being discussed
at https://github.com/cedar-policy/rfcs/pull/80
>>> duration("1h")
3600000ms
>>> datetime("1970-01-01T00:00:00Z")
0ms
@apg
apg / DCPU-16Spec.txt
Created September 1, 2022 17:49 — forked from metaphox/DCPU-16Spec.txt
DCPU-16 Specification
DCPU-16 Specification
Copyright 1985 Mojang
Version 1.7
=== SUMMARY ====================================================================
* 16 bit words
* 0x10000 words of ram
@apg
apg / gist:bc072b9fa00b362c52bbf6e2b69ad502
Created January 2, 2021 00:05
Vegan and Gluten Free Pierogis.
The dough was inspired by a random selection of searching for vegan and gluten free pierogis and getting a feel for what people do, and taking a risk. It largely worked out. They are edible, but I am not much of a cook, so have no idea how to iterate. The dough did not seem like it was going to work, but ended up OK. Boiled for about 3 minutes. Then pan fried with caramelized onions.
Dough:
3 cups Bob’s Red Mill All Purpose, 1:1, Gluten Free Flour
1 teaspoon salt
3/4 cup unsweetened soy milk, couple tablespoons for dough, maybe
1 tablespoon olive oil
1/4 cup water as needed for the dough
@apg
apg / 00 - email.md
Last active December 3, 2020 21:35
to: [email protected] subject: Question about the Pizza65

Hi,

I recently came across the Pizza65 and it looks like a great keyboard! I am hopeful that it will solve my problem but, it's unclear from the specifications and need your help.

I eat a lot of pizza at my desk, and am looking for a keyboard that will also serve as a pizza cutter for when the slices are just too big. Can the Pizza65 also be used as a pizza cutter? If not, can I suggest that your next model include pizza cutting functionality?

Thanks,

Andrew

@apg
apg / map.scm
Created October 25, 2019 19:23
;; map, the naive way
(define (naive-map f xs)
(cond
((null? xs) '())
(else (cons (f (car xs)) (map f (cdr xs))))))
(define (tr-map f xs)
(define (recurse f xs accum)
(cond
((null? xs) (reverse accum))
(defface haiku-success-face
'((t :inherit success))
:group 'haiku-mode)
(defface haiku-error-face
'((t :inherit warning))
:group 'haiku-mode)
(defvar haiku-highlight-keywords
@apg
apg / wc.d
Created June 1, 2018 23:57
Simple wc(1) in D
// $ dmd wc.d
// $ cat /usr/share/dict/words | ./wc
// 235886 235886 2493109
import std.stdio;
void main()
{
int lines = 0;
int words = 0;
@apg
apg / productivity.md
Created April 18, 2018 19:01
Elon Productivity tips

Source of quoted email.

Btw, here are a few productivity recommendations:

  • Excessive meetings are the blight of big companies and almost always get worse over time. Please get of all large meetings, unless you’re certain they are providing value to the whole audience, in which case keep them very short.

  • Also get rid of frequent meetings, unless you are dealing with an extremely urgent matter. Meeting frequency should drop rapidly once the urgent matter is resolved.

  • Walk out of a meeting or drop off a call as soon as it is obvious you aren’t adding value. It is not rude to leave, it is rude to make someone stay and waste their time.

@apg
apg / Methods.md
Created December 26, 2017 21:54
Nick P’s post on methods

Techniques for Ensuring Software Correctness: What Worked in Past and Present (Quick revision of 2016 comment on Lobste.rs)

I find it helps to look to prior successes and tradeoffs to try to understand how to best do engineering. People and teams I've identified as independent inventors of software engineering were Bob Barton of Burroughs B5000, Dijkstra w/ THE OS, and Margaret Hamilton in Apollo & 001 Tool Suite. Each had pieces of the problem with some culminating with later work into the TCSEC and Orange Book’s B3/A1 classes of high-assurance security. At IBM, Fagan invented formal, software inspections for lower defects. Harlan Mills invented a method, Cleanroom Software Engineering, that consistently resulted in low defects even on first use. Became my baseline.

In parallel, the safety-critical embedded community continued using all kinds of their own methods or variations on common ones. They often published "lessons learned" reports with useful information. CompSci researchers continued working on

@apg
apg / README.md
Created December 23, 2017 07:57
Prototype: using Go's ast tools to build a comment parsing contract engine.

Overview

$ go run law.go
package main

import "fmt"

// @require: not-empty: len(x) > 0
func Foo(x string) {