Skip to content

Instantly share code, notes, and snippets.

View matanlurey's full-sized avatar
🌴
On vacation through June 3rd

Matan Lurey matanlurey

🌴
On vacation through June 3rd
View GitHub Profile

Decaf's Wishlist for Podcast Subjects

I am tired of hearing podcasts about:

  • The top 2, 4, 8 at the latest big event
  • Why the Rebel Z6 is bad
  • Why Tauntauns and/or Shoretroopers are good
  • The 1000th interview of LJ or Franz or Luke Cook (Love ya all but seriously)

Here are some free ideas. If you like them and want to use them and feel like paying a royalty:

#!/usr/bin/env node
import clear from "clear";
import chalk from "chalk";
import figlet from "figlet";
import fs from "fs-extra";
import path from "path";
import program from "commander";
import sanitize from "sanitize-filename";
import xmlFmt from "xml-formatter";
@matanlurey
matanlurey / .packages
Created March 4, 2019 18:09
The .packages file for HQ Uplink (a hobby app for Star Wars table top miniatures)
# Generated by pub on 2019-01-23 16:19:00.597501.
analyzer:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer-0.34.2/lib/
analyzer_plugin:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/analyzer_plugin-0.0.1-alpha.6/lib/
args:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/args-1.5.1/lib/
async:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/async-2.0.8/lib/
boolean_selector:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/boolean_selector-1.0.4/lib/
build:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/build-1.1.0/lib/
build_config:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_config-0.3.1+4/lib/
build_resolvers:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_resolvers-0.2.3/lib/
build_runner:file:///Users/matanl/dev/flutter/.pub-cache/hosted/pub.dartlang.org/build_runner-1.1.3/lib/
@matanlurey
matanlurey / app.dart
Last active January 22, 2019 17:26
An example of using InheritedWidget, StreamBuilder, and Firebase.
import 'package:flutter/material.dart';
import 'services.dart';
/// Root application [Widget] for HQ Uplink.
///
/// Receives initial configuration for the app as constructor parameters.
class HQUplinkApp extends StatelessWidget {
@visibleForTesting
static final drawerKey = GlobalKey();
@matanlurey
matanlurey / custom_enum_json_plugin.dart
Created January 22, 2019 00:27
An extension of built_value's StandardJsonPlugin that supports custom enum types
import 'package:built_collection/built_collection.dart';
import 'package:built_value/standard_json_plugin.dart';
/// Extends [StandardJsonPlugin] but also understands custom/external enums.
///
/// See https://github.com/google/built_value.dart/issues/568.
///
/// Example use:
/// ```
/// import 'package:built_value/serializer.dart';
import 'dart:html';
import 'package:meta/dart2js.dart' as dart2js;
import 'optimizations.dart' show isDevMode;
/// A location in the DOM where CSS-styles are inserted for an application.
///
/// Often this is in `<head>`, but it could be in a different location in
/// test environments where the styles get cleared after every test case.
void main() {
var comp1 = Comp1();
var comp2 = Comp2();
comp2.registerEvent(eventHandler1(comp1.onEventInt));
}
class Comp1 {
void onEventInt(int event) {}
}
@matanlurey
matanlurey / loose_member_closures.dart
Created July 14, 2018 00:48
Example of awkwardness
void Function(V) debounce1<V>(void Function(V) callback) {
// TODO: Implement actual debounce.
return (event) => callback(event);
}
class Event {}
// Before adding debounce.
class MyComponent1 {
void onClick(Event) {}
@matanlurey
matanlurey / ban_covariant_function.dart
Created July 13, 2018 23:22
An example of my proposal to ban/lint "covariant Function"
void main() {
// [1] Will fail at runtime.
var cell1 = new Cell1();
try {
cell1.registerCallback((String foo) {});
} on TypeError {
print('cell1.registerCallback() failed');
}
// [2] Will fail statically.
@matanlurey
matanlurey / README.md
Created July 13, 2018 18:35
HNPWA Size Regression (-dev.60 to -dev.68)