Skip to content

Instantly share code, notes, and snippets.

Input

function example(obj: { prop: string | number }): string {
  if (typeof obj.prop === 'string') {
    mutatesProp(obj);
    return obj.prop;
  } else {
    return "default";
 }
@sethladd
sethladd / animated_text_flutter.dart
Created December 19, 2015 19:03
My first animated text with Flutter. This is using a very early version of Flutter. This probably won't work by the time you stumble across this code. :)
import 'package:flutter/material.dart'
show
BuildContext,
Positioned,
Stack,
State,
StatefulComponent,
Text,
Widget,
runApp;
@emilniklas
emilniklas / tether_protocol_1.0.md
Last active December 7, 2015 14:44
Tether Protocol v1.0

The Tether Messaging Protocol

Version 1.0

This Gist is the draft document for the Tether Messaging Protocol implemented in the Tether package for Dart.

Introduction

The Web is by definition a very connected platform. A device connected to the internet virtually has access to every other device on the web. There are multiple protocols that describe communications between these devices. For web pages, the dominating protocol is HTTP.

HTTP at the highest level is a standard for mapping resources and actions applied to those resources to a series of methods (GET, POST, PUT, PATCH, DELETE, OPTIONS and more) and URIs.

@trevburley
trevburley / README.md
Last active August 29, 2015 14:25
Query a MySQL database with Dart and SQLJocky