Skip to content

Instantly share code, notes, and snippets.

View tooolbox's full-sized avatar

Matt Mc tooolbox

  • Non-Profit
  • Los Angeles, California
View GitHub Profile
@tooolbox
tooolbox / pithy-android.md
Created May 16, 2020 00:58
Pithy Android Factoids
@tooolbox
tooolbox / go2-contracts-angle-braces.md
Last active September 3, 2020 13:36
Angle Brace Delimiters for Go Contracts

Angle Brace Delimiters for Go Contracts

This document references the Contracts Draft Design for Go Generics, dated 31 July 2019.

The current design uses parentheses to delimit type parameter clauses, but this makes the code difficult to read. This is covered briefly in Non-Parenthetical Delimiters from the essay Towards Clarity: Syntax Changes for Contracts in Go, as well as in many other points of feedback which can be found at https://github.com/golang/go/wiki/Go2GenericsFeedback as linked documents or inline comments.

The official draft states:

Why not use the syntax F<T> like C++ and Java?
When parsing code within a function, such as v := F<T>, at the point of seeing the < it's ambiguous whether we are seeing a type instantiation or an expression using the < operator. Resolving that requires effectively unbounded lo

@tooolbox
tooolbox / go2-contracts-feedback.md
Last active August 24, 2023 23:27
Go 2 Contracts Feedback - May 2020

Towards Clarity: Syntax Changes for Contracts in Go

There are two main parts to the Contracts Draft Design:

  • Type Parameters
  • Contracts

Type Parameters are mostly independent of Contracts; Contracts builds on Type Parameters. The two concepts are well thought-out and many corner cases have been looked at.

These are some specific points that I think are done well by the current generics draft proposal, not in any particular order:

  • Type parameters (generics!) in functions, structs, etc.
@tooolbox
tooolbox / Go2GenericType.go
Last active April 30, 2020 21:54 — forked from Splizard/Go2GenericType.go
Go 2 generics without syntax changes, 1 new type, 1 new builtin.
//A generics proposal for Go, introducing one new type (generic) and one new builtin function (typeof), no syntax changes.
//Function add takes arguments of any type.
//The return value is automatically inferred based on the arguments, can be inlined by the compiler.
//Both arguments must be the same type and addable or else a compiler error will be raised.
//It's the developer's responsibility to document which types can be passed to this function.
func add(a, b generic) generic {
return a+b
}
@tooolbox
tooolbox / good-software.md
Created April 16, 2020 05:10
Where good software comes from, by Melinda Varian
  1. Really good software can be written only by very small groups of very skilled programmers.
  2. Really good software is almost always a labor of love.
  3. Really good software is almost always begun because the author himself needs it; it makes his computer do something that he really wants it to do.
  4. Really good software is never finished; it continues to grow. If it doesn’t grow, it decays.
  5. To evolve into really good software, a program or system must be “hacked at”.
  6. To evolve into really good software and remain good, a program or system must develop an intelligent, adventurous, passionate user community with enough influence to be able to guide its further development.
@tooolbox
tooolbox / chime.sh
Last active April 9, 2020 03:00
Script for launching Chime from the command line
#! /bin/sh
# Copy to /usr/local/bin/chime
# Use:
# cd my-project
# chime .
open -a /Applications/Chime.app/Contents/MacOS/Chime $@
@tooolbox
tooolbox / chime-wishlist.md
Last active September 14, 2020 17:31
List of feature requests or bug reports for Chime

Moved into comments

...To support emoji and screenshots.

@tooolbox
tooolbox / monokai-light.json
Last active April 8, 2020 19:16
Monokai Light theme for Chime
{
"display_name": {
"en": "Monokai Light"
},
"colors": {
"editor.background": "#fafafa",
"editor.selection": "#ccc9ad",
"editor.insertion-point": "#666663",
"syntax.default": "#000000",
@tooolbox
tooolbox / iTerm2MacKeys.itermkeymap
Created March 22, 2020 04:01
My iTerm2 keybindings for Mac (as of Catalina)
{
"Touch Bar Items": [],
"Key Mappings": {
"0xf72d-0x20000": {
"Text": "",
"Action": 8
},
"0xf72b-0x100000": {
"Text": "",
"Action": 4