Skip to content

Instantly share code, notes, and snippets.

View tugberkugurlu's full-sized avatar
:shipit:
💥 shakalaka

Tugberk Ugurlu tugberkugurlu

:shipit:
💥 shakalaka
View GitHub Profile
@jchannon
jchannon / Test.cs
Last active November 24, 2015 17:34
public class SomeFixture : IDisposable
{
private DockerClient client;
public SomeFixture()
{
Console.WriteLine("SomeFixture ctor: This should only be run once");
//Using https://github.com/ahmetalpbalkan/Docker.DotNet
@davidfowl
davidfowl / hub.cs
Last active December 14, 2015 17:38
Future of filtering in SignalR
public class MyHub : Hub
{
public Task SendToQuery(string query, string value)
{
// Call the send to everybody that has the specified query string value
return Clients.Query(c => c.QueryString[query] == value).send();
}
}
@pcibraro
pcibraro / HawkHandler
Created July 24, 2013 17:45
Katana Authentication Handler for Hawk
public class HawkAuthenticationHandler : AuthenticationHandler<HawkAuthenticationOptions>
{
private readonly ILogger logger;
public HawkAuthenticationHandler(ILogger logger)
{
this.logger = logger;
}
protected override Task<AuthenticationTicket> AuthenticateCore()
@bradwilson
bradwilson / vs2013-normal-menus.ps1
Created November 2, 2013 16:55
Say goodbye to VS2013's SHOUTING MENUS
Set-ItemProperty -Path HKCU:\Software\Microsoft\VisualStudio\12.0\General -Name SuppressUppercaseConversion -Type DWord -Value 1
@bradygaster-zz
bradygaster-zz / Configuration.cs
Created October 28, 2012 19:25
Code associated with a location API used to demonstrate EF Spatial and Windows Azure Web Sites
internal sealed class Configuration : DbMigrationsConfiguration<SpatialDemo.Models.SpatialDemoContext>
{
public Configuration()
{
AutomaticMigrationsEnabled = true;
}
protected override void Seed(SpatialDemo.Models.SpatialDemoContext context)
{
context.Locations.AddOrUpdate((x) => x.Name,
@AlexZeitler
AlexZeitler / set-prompt.sh
Last active September 9, 2016 09:52
bash prompt including current git branch and current docker-machine
export PS1="\n\w\[\033[m\]\[\e[1;32m\]\$(__git_ps1) \[\033[36m\]\${DOCKER_MACHINE_NAME}\[\e[00m\]\n\[\033[32m\]⋙ \[\e[00m\] "
@revett
revett / README.md
Last active November 7, 2016 11:36
Tutum Zero Downtime Re-deploy

Tutum Zero Downtime Re-deploy

cats.jpg

I tweeted Tutum last night asking if they're looking at implementing zero downtime re-deploys for a given service. Slightly surprised by their response as it seems like a critical feature if you want to use the service for a production environment.

"not a top priority, but by Spring :)"

As Tutum currently doesn't support graceful termination of containers within a service, I was experiencing a 5-10 second window of 503 errors, so decided to use the following hack (code below) until the feature is officially implemented.

@freeformz
freeformz / gist:4552031
Last active August 5, 2017 20:18
statvfs (cgo)
package main
// build +cgo
import (
"fmt"
"os"
"unsafe"
)
@RichardSlater
RichardSlater / MongoDB.ps1
Created January 16, 2014 17:37
Desired State Configuration to Install MongoDB on Windows Server 2013
configuration MongoDB {
param (
[string[]]$ComputerName = $env:ComputerName
)
node $ComputerName {
File SetupFolder {
Type = 'Directory'
DestinationPath = "C:\setup"
Ensure = 'Present'
}