Skip to content

Instantly share code, notes, and snippets.

Alexander Zeitler AlexZeitler

Block or report user

Report or block AlexZeitler

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
View gist:af556571a733fc5c20be01ea9ae487dc
Scenario: different business teams building parts of a product, splitted by business domains. We are anly communicate via domain events published to a message bus and sometimes via published links.
As the domain events are the "contracts" between the business domains we want to declare and enforce the schemas of the events.
Our solution is built in node but the concept could work in any stack.
@zcaceres
zcaceres / Error-Handling-Patterns-Express.md
Last active Nov 16, 2019
error handling patterns in Express
View Error-Handling-Patterns-Express.md

Handling Errors

Express.js makes it a breeze to handle errors in your routes.

Express lets you centralizes your error-handling through middleware.

Let's look at patterns for how to get the most out of your error-handling.

First, our error-handling middleware looks like this:

@kevinswiber
kevinswiber / siren_api.yml
Last active Sep 20, 2019
Siren definitions for Open API Specification
View siren_api.yml
swagger: '2.0'
info:
title: Siren API
description: Template for a Siren API
version: '0.1.0'
schemes:
- http
- https
basePath: /
produces:
@aliostad
aliostad / azure-vm-bootstrapper.ps1
Last active Apr 18, 2016
Azure VM bootstrapper
View azure-vm-bootstrapper.ps1
# Usage:
# iex ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/aliostad/a20f0c8d6a439dcff34e63e4a6559008/raw/0e445d869eb47e525512053638489920547a7d75/azure-vm-bootstrapper.ps1'))
# Bootstraps the Azure VM by modyifying settings and installing below:
# 1. Turn off annoying Intrenet Explorer enhanced security
# 2. Install chocolatey
# 3. Install PerfView
# 4. Install DebugView
# 5. Install SuperBenchmarker
# 6. Install notepad++
# 7. Install windbg
@makomweb
makomweb / csharp_implicit_type_conversion.cs
Last active Aug 29, 2015
C# implicit type conversion (see http://msdn.microsoft.com/en-us/library/zk2z37d3.aspx for a more detailed explanation)
View csharp_implicit_type_conversion.cs
public class ImplicitConversionTest
{
public class A
{
public string Member { get; set; }
public static implicit operator string(A self)
{
return self.Member;
}
@kagemusha
kagemusha / gist:5866759
Created Jun 26, 2013
Using Debugger with Grunt
View gist:5866759
version: grunt-cli v0.1.8
1. Install node-inspector globally (-g)
npm install -g node-inspector
2. Add debugger statements to your code
3. Run your grunt task in debug mode
@jimothyGator
jimothyGator / README.md
Last active Nov 16, 2019
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
View README.md
mkdir -p /usr/local/etc/nginx/sites-{enabled,available}
cd /usr/local/etc/nginx/sites-enabled
ln -s ../sites-available/default.conf
ln -s ../sites-available/default-ssl.conf

File locations:

  • nginx.conf to /usr/local/etc/nginx/
  • default.conf and default-ssl.conf to /usr/local/etc/nginx/sites-available
  • homebrew.mxcl.nginx.plist to /Library/LaunchDaemons/
@michaelcox
michaelcox / SpecRunner.js
Last active Sep 30, 2019
Browser Unit Testing with Backbone Mocha Chai and RequireJS
View SpecRunner.js
require.config({
baseUrl: '/backbone-tests/',
paths: {
'jquery' : '/app/libs/jquery',
'underscore' : '/app/libs/underscore',
'backbone' : '/app/libs/backbone',
'mocha' : 'libs/mocha',
'chai' : 'libs/chai',
'chai-jquery' : 'libs/chai-jquery',
'models' : '/app/models'
View gist:3782072
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Raven.Client.Document;
namespace OurNamespace
{
public sealed class RavenStore :IDisposable
{
@benfoster
benfoster / gist:3655639
Created Sep 6, 2012
Consuming my ASP.NET Web API client
View gist:3655639
static void Main(string[] args)
{
var configuration = ClientConfiguration.Initialize(configure =>
{
configure.WithApiKey("1234-5678");
configure.WithBaseUri("http://localhost.fiddler:64511");
configure.WithSiteId(1);
});
var pages = configuration.GetPagesClient();
You can’t perform that action at this time.