Skip to content

Instantly share code, notes, and snippets.

Avatar

Aluan Haddad aluanhaddad

View GitHub Profile
View ng-module-example.ts
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
@aluanhaddad
aluanhaddad / app.html
Created Dec 2, 2017 — forked from davismj/app.html
Test: Upload custom element
View app.html
<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
Last active Dec 2, 2017 — forked from davismj/app.html
Test: Upload custom element
View app.html
<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>
View index.html
<!DOCTYPE html>
<html>
<head>
<script src="https://unpkg.com/systemjs@0.20.19/dist/system.src.js"></script>
<script>
SystemJS.config({
transpiler: 'plugin-babel',
babelOptions:{presets:['babel-preset-react']},
map: {
'react': 'https://unpkg.com/react@16.2.0/umd/react.development.js',
@aluanhaddad
aluanhaddad / Bson.cs
Created Jan 22, 2018
Bson Serialization/Deserialization
View Bson.cs
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();
@aluanhaddad
aluanhaddad / Example.cs
Created Nov 22, 2017
C# Observable HTTP
View Example.cs
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;