Skip to content

Instantly share code, notes, and snippets.

jcob-ross

Block or report user

Report or block jcob-ross

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@davidfowl
davidfowl / Example1.cs
Last active Oct 10, 2019
How .NET Standard relates to .NET Platforms
View Example1.cs
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@btroncone
btroncone / ngrxintro.md
Last active Oct 21, 2019
A Comprehensive Introduction to @ngrx/store - Companion to Egghead.io Series
View ngrxintro.md

Comprehensive Introduction to @ngrx/store

By: @BTroncone

Also check out my lesson @ngrx/store in 10 minutes on egghead.io!

Update: Non-middleware examples have been updated to ngrx/store v2. More coming soon!

Table of Contents

@endash
endash / async-observables.md
Last active Jul 14, 2016
Asynchronous observables in Angular 2 and their issues
View async-observables.md

The problem

In some situations it is beneficial to force an observable to resolve subscriptions asynchronously, via use of the observeOn operator. Failing that, it is at least possible to force an observable to resolve asynchronously. The issue from an Angular perspective is that we usually want our subscribe callback to run in the Angular zone, otherwise change detection won't automatically kick off. Additionally, inside an asynchronous observer callback setTimeout does not run in the app zone, eliminating a potentially obvious solution. To code defensively, one might use NgZone.run wherever there's a possibility that an observable is async. Unfortunately, this has the knock-on effect of causing errors if the observable is not async. To prevent those errors observables can be uniformly forced async, with NgZone used in the subscribe callback, resulting in uniform, proper behaviour. These measures have a not insubstantial technical cost.

I am not presently aware of a way to ensure that cal

@masahirompp
masahirompp / User.ts
Last active Feb 15, 2019
mongoose + typescript
View User.ts
/// <reference path="../tsd/tsd.d.ts" />
import mongoose = require('mongoose');
import passport = require('passport');
interface IUser extends mongoose.Document {
provider: string;
id: string;
authorId: string;
displayName: string;
@ntulip
ntulip / HtmlSanitizer.cs
Created Feb 7, 2011
HTML Sanitizer for C#
View HtmlSanitizer.cs
/**
Copyright (c) 2009 Open Lab, http://www.open-lab.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
You can’t perform that action at this time.