Skip to content

Instantly share code, notes, and snippets.

View vilterp's full-sized avatar

Pete Vilter vilterp

View GitHub Profile
import { Context, InvariantViolation, System } from "../context";
const useLock = true;
type State =
| { type: "MoneyHolder"; onHand: number }
| { type: "Lock"; holder: string | null; waiters: string[] };
async function atm(ctx: Context<State, Msg>) {
const initialAmount = 0;
def append_range(ranges, current_range_start, current_range_end):
if current_range_start == current_range_end:
ranges.append(current_range_start)
else:
ranges.append((current_range_start, current_range_end))
def compress_list_of_integers(ints):
if len(ints) == 0:
return []
ranges = []
We can make this file beautiful and searchable if this error is corrected: It looks like row 4 should actually have 5 columns, instead of 2 in line 3.
77,R338O7kqll/vLZD6UeiHxEJ8Za6D50r2VlZGGTk+eYvABb3K8RB4hKZiYP6RSuLh5HhrjsvuEHHtODZM1yUeCw==,"{""file"": {}, ""type"": ""FILE_UPLOAD_START"", ""uploader"": {""req"": {}, ""file"": {}, ""_callbacks"": {""$end"": [null], ""$error"": [null], ""$progress"": [null]}}}",https://localhost/dataset/Wut-is-going-on/nivb-z524,1475114093197
78,R338O7kqll/vLZD6UeiHxEJ8Za6D50r2VlZGGTk+eYvABb3K8RB4hKZiYP6RSuLh5HhrjsvuEHHtODZM1yUeCw==,"{""type"": ""FILE_UPLOAD_PROGRESS"", ""percent"": 29.66360845195578, ""uploader"": {""req"": {}, ""file"": {}, ""_callbacks"": {""$end"": [null], ""$error"": [null], ""$progress"": [null]}}}",https://localhost/dataset/Wut-is-going-on/nivb-z524,1475114093231
79,R338O7kqll/vLZD6UeiHxEJ8Za6D50r2VlZGGTk+eYvABb3K8RB4hKZiYP6RSuLh5HhrjsvuEHHtODZM1yUeCw==,"{""type"": ""FILE_UPLOAD_ANALYZING"", ""uploader"": {""req"": {}, ""file"": {}, ""_callbacks"": {""$end"": [null], ""$error"": [null], ""$progress"": [null]}}}",https://localhost/dataset/Wut-is-going-on/nivb-z524,1475114093249
80,R338O7kqll/vLZD6UeiH
module Joins exposing (..)
import Dict exposing (..)
join : List a -> List b -> (a -> b -> Bool) -> List (a, List b)
join left right joinTest =
left
|> List.map (\leftItem ->
right
module ElmAST where
import Json.Decode
import Json.Decode exposing ((:=))
import Json.Encode exposing (Value)
-- The following module comes from bartavelle/json-helpers
import Json.Helpers exposing (..)
import Dict
import Set
peterv@vilterp-mbp:flow-test$ flow version
Flow, a static type checker for JavaScript, version 0.25.0
peterv@vilterp-mbp:flow-test$ flow
flowTest.js:7
7: var y: Foo = {...x, a: 5};
^^^^^^^^^^^^ object literal. This type is incompatible with
7: var y: Foo = {...x, a: 5};
^^^ union: object type(s)
Member 1:
3: type Foo = { type: 'foo', a: number, b: number } | { type: 'bar', c: string };
module AST where
import Dict exposing (Dict)
type alias Module =
{ name : List String
, exports : List Exposable
, imports : Import
, declarations : List Declaration

I18n with Records

Goals:

  1. Elm's typechecker enforces that
  • each localization has all the same messages.
  • the messages you are referring to in your view code exist.
  1. Only the localized strings for the current locale are sent across the wire
  2. Messages which have interpolations are typechecked as well
@vilterp
vilterp / id_rsa.pub
Last active December 14, 2015 18:55
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCguoAax3oAZjCdoDenwDDtVIFHLDVZCKSPX1lDLHUsBaphArtL2f0am50tq8hkiZulap6eRFKgQupSpD42g12eM7cXoaijUi05allxKwdnlm54rkFpQ+mDpgElgCl8T4c16TzlyVEXuxxsRZF9iprOkfdp1fskc2qiJdOHEcY8fAQpnfruKAyyd+9ZmpYWHHM+agZNet1iS2ypHRtBFhlQDyRoFIRHD63KaKx2klrXPgnrlfLPWbiKD87QK2Wa/mkp8yosZNrXtTfP0sLaaYQXOBlG5z2G6RzPoNREYV50RK73ux5vtvqHeJCil7QJI2FvzZVD7UEhXnSGWFKlX/gF [email protected]
#!/usr/bin/osascript
display notification "is done" with title "Your Shit"