Skip to content

Instantly share code, notes, and snippets.

View tugberkugurlu's full-sized avatar
💥 shakalaka

Tugberk Ugurlu tugberkugurlu

💥 shakalaka
View GitHub Profile
tugberkugurlu /
Created October 2, 2015 12:13 — forked from soheilhy/
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for,, and on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

View project . json
"dependencies": {
"Microsoft.Composition": "1.0.30" -- Is this nuget dependencies for all frameworks? (yes)
"frameworks": {
"dnx451": {
"dependencies": { -- Is this nuget just for dnx451? (yes)
"frameworkAssemblies": {
"System.Globalization": "", --This is GAC for dnx451? (yes)
View MongoDB.ps1
configuration MongoDB {
param (
[string[]]$ComputerName = $env:ComputerName
node $ComputerName {
File SetupFolder {
Type = 'Directory'
DestinationPath = "C:\setup"
Ensure = 'Present'
View Streaming.cs
public class Configuration(IAppBuilder app)
// TaskCompletionSource
app.Map("/streaming-api1", map =>
// Streaming API using SignalR
var connectionContext = GlobalHost.ConnectionManager.GetConnectionContext<RawConnection>();
map.Run(async context =>
View Configuration.cs
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,
View Download and Install MongoDB as Windows Service PowerShell Script
Set-ExecutionPolicy RemoteSigned
$mongoDbPath = "C:\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = ""
$zipFile = "$mongoDbPath\"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.2.3"
if ((Test-Path -path $mongoDbPath) -eq $True)
View gist:4559493
<add key="aspnet:UseHostHeaderForRequestUrl" value="true"/>
View gist:4489104
using Newtonsoft.Json;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Diagnostics.CodeAnalysis;
using System.Dynamic;
using System.Linq;
using System.Linq.Expressions;
using System.Net;
View SubscriptionDemo.cs
public void Should_be_able_to_consume()
var autoResetEvent = new AutoResetEvent(false);
using (var channel = connection.OpenChannel())
var settings = new ConsumerSettings(queue)
View gist:4416777
using System;
using System.Collections.Concurrent;
using System.Threading;
using System.Threading.Tasks;
using System.Threading.Tasks.Dataflow;
namespace TDFDemo
class Program