See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope>
is optional
public static partial class LinqExtensions | |
{ | |
public static Maybe<C> SelectMany<A, B, C>(this Maybe<A> ma, Func<A, Maybe<B>> f, Func<A, B, C> select) => ma.Bind(a => f(a).Map(b => select(a, b))); | |
} |
// Zero-Clause BSD (more permissive than MIT, doesn't require copyright notice) | |
// | |
// Permission to use, copy, modify, and/or distribute this software for any purpose | |
// with or without fee is hereby granted. | |
// | |
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
// WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY | |
// AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, | |
// INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS | |
// OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER |
<h1>Angular 2 Recursive List</h1> | |
<ul> | |
<ng-template #recursiveList let-list> | |
<li *ngFor="let item of list"> | |
{{item.title}} | |
<ul *ngIf="item.children.length > 0"> | |
<ng-container *ngTemplateOutlet="recursiveList; context:{ $implicit: item.children }"></ng-container> | |
</ul> | |
</li> | |
</ng-template> |
Outdated note: the process is a lot easier now: after you brew install postgresql
you can initialize or stop the daemon with these commands: brew services start postgresql
or brew services stop postgresql
.
new out put may look like
To have launchd start postgresql now and restart at login:
brew services start postgresql
Or, if you don't want/need a background service you can just run:
pg_ctl -D /usr/local/var/postgres start
const handlers = Symbol('handlers'); | |
// adapts a handler class to a common interface | |
// (technically this one isn't required - the handler class already implements the same interface) | |
class ClassDispatchable { | |
constructor(theClass) { | |
this.theClass = theClass; | |
} | |
handle(command) { | |
return (new this.theClass).handle(command); |
// Bring Mongoose into the app | |
var mongoose = require( 'mongoose' ); | |
// Build the connection string | |
var dbURI = 'mongodb://localhost/mongoose-best-practices'; | |
// Create the database connection | |
mongoose.connect(dbURI); | |
// CONNECTION EVENTS |
Using Microsoft.Owin.Security
along with .NET Web API 2 for authentication on Single Page Applications.
My example is split up into 2 different projects, API which is WebAPI2 project and MyProj which is a basic MVC that contains primarily only JavaScript/CSS/etc and the startup classes.
namespace API
{
# Note (November 2016): | |
# This config is rather outdated and left here for historical reasons, please refer to prerender.io for the latest setup information | |
# Serving static html to Googlebot is now considered bad practice as you should be using the escaped fragment crawling protocol | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name yourserver.com; | |
root /path/to/your/htdocs; |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>