Skip to content

Instantly share code, notes, and snippets.

View korokd's full-sized avatar

Diogo Korok korokd

View GitHub Profile
@Janiczek
Janiczek / ElmHelloWorld.elm
Created February 24, 2022 22:32
Elm WebComponents
module ElmHelloWorld exposing (main)
import Html exposing (Html)
import Json.Decode as Decode exposing (Value)
import WebComponent
type alias Flags =
{ name : Maybe String }
@cdyk
cdyk / bytesinwasm.md
Last active February 12, 2021 06:53
Who to blame for the bytes in the WASM?

Who to blame for the bytes in the WASM?

Christopher Dyken

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.

@cassaram09
cassaram09 / deepClone.js
Last active October 12, 2021 06:22
JavaScript deep clone function
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){
@mikemimik
mikemimik / main.dart
Last active August 3, 2022 04:21
Flutter: Custom theme data
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(
@staltz
staltz / introrx.md
Last active September 20, 2024 10:10
The introduction to Reactive Programming you've been missing