Skip to content

Instantly share code, notes, and snippets.

View samuelgoto's full-sized avatar
💭
hello world!

Sam Goto samuelgoto

💭
hello world!
View GitHub Profile

This is a very early stage 0 exploration to add enums to Javascript, as a syntatic simplication over a common pattern to define enumerations.

Introduction

Enums come up often in code bases (TODO: try to estimate a number) and it is easy to get it incorrectly. Specifically, it is easy to forget:

  • to Object.freeze the object
  • to declare it as a const which avoids having the symbol redefined

With this in mind, we propose a nem keyword to javascript, say enum which de-sugars to the following:

@samuelgoto
samuelgoto / microforms.md
Last active October 16, 2017 17:01
A hypermedia API file type

Microforms

microforms is a file type (application/microforms) designed to expose REST endpoints.

The syntax, inspired by kotlin, is designed to intermingle data (text) with control (hypertext) more ergonomically (compared to HTML or JSON).

Like HTML, it defines a set of affordances (e.g. links, forms, imports, etc, designed to be isomorphic to HTML) and is typically used with a client side library that follows instructions sent by the server.

{

Markdown

example:

# import "http://commonsense.org/stdlib.en"
# import "http://opentable.com/restaurants.en"

...

Message Passing

const api = await remote {
  import foo from 'foo.js';

  export class A {
    func() {

Introduction

I'll use this doc here to aggregate some extra information for people visting the Bay Area for the TC39 meeting.

Feel free to add advice at the bottom as a comment!!

Airports

  • San Jose Airport: smaller but great airport, really close to the meeting, super conveninent. Smaller than SFO so fewer flights, but if you find anything landing there I'd use it. Could save you a lot of headache worrying about traffic to SFO.
  • San Francisco Airport: bigger airport, farther from the meeting. Huge, so a lot more options to fly in and out. About 45 mins away from the meeting without traffic and 1h30 hours with rush hour traffic.
@samuelgoto
samuelgoto / gns.md
Last active January 27, 2018 00:30

A human-readable and shareable naming system to open location codes on top of DNS with the proper authority verification. The system works as a hierarchical delegation of authority which is used to enforce authority: the owner of a GNS sub-domain should indeed be the owner of that geo location.

Examples

  • 23450.mount-eden.saratoga.ca.us
  • 360.aldo-grigol.campinas.sp.br

Use Cases

Publishing digital content associated with an address that you own: augmented reality assets, post signs, security codes, menus, reservation forms, etc.

Building blocks:

  • DHT as a service
  • PubSub as a service
  • Load balancing as a service
  • geo isolation instrument

Services:

  • Quota management

Principles of Adult Behavior by John Berry Barlow:

https://en.wikipedia.org/wiki/John_Perry_Barlow

  • Be patient. No matter what.
  • Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him in the same language and tone of voice.
  • Never assume the motives of others are, to them, less noble than yours are to you.
  • Expand your sense of the possible.
  • Don’t trouble yourself with matters you truly cannot change.
  • Expect no more of anyone than you can deliver yourself.