Skip to content

Instantly share code, notes, and snippets.

Michael Bylstra mbylstra

Block or report user

Report or block mbylstra

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View elm-typescript-types-comparison.md
@nepsilon
nepsilon / auto-backup-your-configuration-files-with-vim.md
Last active Nov 18, 2019
Auto-backup your configuration files with Vim — First published in fullweb.io issue #71
View auto-backup-your-configuration-files-with-vim.md

Auto-backup your configuration files with Vim

Not using versioning on your configuration files and editing them with Vim?

Use Vim’s backup option to automatically keep a copy of past versions. To put in your ~/.vimrc:

"Turn on backup option
set backup
View crashReporter.js
// @flow weak
import raven from 'raven-js';
import config from 'config';
const SENTRY_DSN = 'https://XXXX@app.getsentry.com/YYYY';
function sendQueue() {
const sentryOffline = JSON.parse(window.localStorage.sentryOffline);
@yang-wei
yang-wei / decode.md
Last active Sep 24, 2019
Elm Json.Decode tutorial and cheatsheet
View decode.md

When receiving JSON data from other resources(server API etc), we need Json.Decode to convert the JSON values into Elm values. This gist let you quickly learn how to do that.

I like to follow working example code so this is how the boilerplate will look like:

import Graphics.Element exposing (Element, show)
import Task exposing (Task, andThen)
import Json.Decode exposing (Decoder, int, string, object3, (:=))

import Http
@yang-wei
yang-wei / destructuring.md
Last active Oct 30, 2019
Elm Destructuring (or Pattern Matching) cheatsheet
View destructuring.md

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !

Tuple

myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
@Skinney
Skinney / Main.elm
Created Nov 26, 2015
AWS Lambda Elm
View Main.elm
module Main where
import Signal
type alias Message =
{ operation : String
, message : String
}
@mgold
mgold / proposal.elm
Last active Feb 12, 2016
Elm mailbox revamp
View proposal.elm
-- a distilation of https://github.com/elm-lang/elm-plans/issues/7
{- Mailbox is renamed Dispatcher, although this name is the part I'm least certain about.
The address field is replaced with a dispatch field.
It's minor, but I've found it helpful to put dispatch second, since the signal is easier to explain.
-}
type alias Dispatcher a =
{ signal : Signal a
, dispatch : a -> Message -- the big change
}
View Elm Style Guide.md

Elm Style Guide

Purpose

The goal of the style guide is foremost to promote consistency and reuse of pattern from other languages in order to improve readability and make Elm easier for beginners. This includes moving Elm away from Haskell’s indentation style and even making some parts look closer to JavaScript. These decisions are intentional.

We would like Elm to look friendly and familiar to users of any language — especially JavaScript — so they can discover Elm’s powerful features without being overwhelmed. This does not intend to weaken or discourage any features of Elm, but instead to make them more accessible.

A secondary goal of the style guide is to encourage short diffs when changes are made. This makes changes more clear, and helps when multiple people are collaborating.

Whitespace

View test-django-install.py
import django
django.VERSION
You can’t perform that action at this time.