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
mattdot / gist:1086078
Created Jul 16, 2011
WCF Web API: Extension methods for requesting a response in JSON, and for setting Basic auth headers
View gist:1086078
public static class HttpClientExtensionMethods
public static void SetBasicAuth(this HttpClient httpClient, string userName, string password)
var byteArray = Encoding.ASCII.GetBytes(userName + ":" + password);
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(byteArray));
public static void AcceptJson(this HttpClient httpClient)
pmhsfelix / gist:1140101
Created Aug 11, 2011
Operation URI resolution
View gist:1140101
class TheResolverTestService
public void Oper1(string prm1, int prm2)
[WebGet(UriTemplate = "op2/{prm1}/middle/{prm2}")]
darkiri / gist:2039990
Created Mar 14, 2012
is there a method which returns all .net base types/structs that System.Convert is able to convert to/from?
View gist:2039990
typeof (Convert)
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 =>
var pages = configuration.GetPagesClient();
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
michaelcox / SpecRunner.js
Last active Sep 30, 2019
Browser Unit Testing with Backbone Mocha Chai and RequireJS
View SpecRunner.js
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'
jimothyGator /
Last active Oct 1, 2019
Nginx configuration for Mac OS X with Homebrew, using sites-enabled directory.
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/
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
makomweb / csharp_implicit_type_conversion.cs
Last active Aug 29, 2015
C# implicit type conversion (see 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;
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(''))
# 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
You can’t perform that action at this time.