Recently, I've worked with Emscripten, producing web-assembly from C++. As a result, I've become curious of how much the wasm-binary grows by including this or that code. Even though caring about code size seems to be out of fashion since we stopped using floppy disks to move programs around, it does matter somewhat on the web, as every client has to download the binary, maybe over a cellular connection etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module ElmHelloWorld exposing (main) | |
import Html exposing (Html) | |
import Json.Decode as Decode exposing (Value) | |
import WebComponent | |
type alias Flags = | |
{ name : Maybe String } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function deepClone(source){ | |
// If the source isn't an Object or Array, throw an error. | |
if ( !(source instanceof Object) || source instanceof Date || source instanceof String) { | |
throw 'Only Objects or Arrays are supported.' | |
} | |
// Set the target data type before copying. | |
var target = source instanceof Array ? [] : {}; | |
for (let prop in source){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'theme.dart' as Theme; | |
void main() { | |
runApp( | |
new MaterialApp( | |
title: 'CompanyApp', | |
color: Theme.CompanyColors.blue[500], | |
theme: Theme.CompanyThemeData, | |
home: new Scaffold( |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.