Skip to content

Instantly share code, notes, and snippets.

View aluanhaddad's full-sized avatar

Aluan Haddad aluanhaddad

View GitHub Profile
@aluanhaddad
aluanhaddad / Bson.cs
Created January 22, 2018 15:34
Bson Serialization/Deserialization
void Main()
{
var bson = new MongoDB.Bson.BsonDocument(new Dictionary<string, object>
{
["ChildishField"] = "childish",
["AnotherChildishField"] = "more childish"
});
var serialized = bson.ToString().Dump();
MongoDB.Bson.Serialization.BsonSerializer.Deserialize<Child1>(serialized).Dump();
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/[email protected]/dist/system.src.js"></script>
<script>
SystemJS.config({
transpiler: 'plugin-babel',
babelOptions:{presets:['babel-preset-react']},
map: {
'react': 'https://unpkg.com/[email protected]/umd/react.development.js',
@aluanhaddad
aluanhaddad / app.html
Last active December 2, 2017 13:05 — forked from davismj/app.html
Test: Upload custom element
<template>
<require from="upload"></require>
<main style="padding: 1rem;">
<dl>
<dt>Behaves like a vanilla button.</dt>
<dd>
<upload file.bind="f1">Upload</upload>
<span if.bind="f1">${f1.name} selected</span>
</dd>
@aluanhaddad
aluanhaddad / app.html
Created December 2, 2017 12:15 — forked from davismj/app.html
Test: Upload custom element
<template>
<require from="upload"></require>
<main style="padding: 1rem;">
<dl>
<dt>Behaves like a vanilla button.</dt>
<dd>
<upload file.bind="f1">Upload</upload>
<span if.bind="f1">${f1.name} selected</span>
</dd>
@aluanhaddad
aluanhaddad / Example.cs
Created November 22, 2017 23:31
C# Observable HTTP
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections.Immutable;
using System.Linq;
using System.Net.Http;
using System.Reactive;
using System.Reactive.Concurrency;
using System.Reactive.Disposables;
using System.Reactive.Joins;
using System.Reactive.Linq;
export type Constructor = new (...args: any[]) => any;
export type Decorator = (target: Constructor) => Constructor;
export declare function NgModule<P1, P2, P3, P4, E1, E2, E3, E4>(obj: {providers: [P1, P2, P3, P4], exports: [E1, E2, E3, E4]}): Decorator & typeof obj
export declare function NgModule<P1, P2, P3, E1, E2, E3, E4>(obj: {providers: [P1, P2, P3], exports: [E1, E2, E3, E4]}): Decorator & typeof obj
export declare function NgModule<P1, P2, E1, E2, E3, E4>(obj: {providers: [P1, P2], exports: [E1, E2, E3, E4]}): Decorator & typeof obj
export declare function NgModule<P1, P2, P3, E1, E2, E3>(obj: {providers: [P1, P2, P3], exports: [E1, E2, E3]}): Decorator & typeof obj
export declare function NgModule<P1, E1, E2, E3, E4>(obj: {providers: [P1], exports: [E1, E2, E3, E4]}): Decorator & typeof obj
export declare function NgModule<P1, P2, E1, E2>(obj: {providers: [P1, P2], exports: [E1, E2]}): Decorator & typeof obj
export declare function NgModule<P1, E1, E2>(obj: {providers: [P1], exports: [E1, E2]}): D