Skip to content

Instantly share code, notes, and snippets.

View mastoj's full-sized avatar

Tomas Jansson mastoj

View GitHub Profile
@mastoj
mastoj / StartEs
Created September 9, 2014 11:49
Sample to start Elasticsearch that fails
java -classpath ".\*;.\sigar\*;" -Delasticsearch -Des-foreground=yes -Des.path.home=".." -Des.path.data="c:\tmp\elas\data" -Des.http.port=9201 org.elasticsearch.bootstrap.Bootstrap
#r "../packages/FsPickler.Json.0.9.6/lib/net45/FsPickler.Json.dll"
#r "../packages/FsPickler.0.9.6/lib/net45/FsPickler.dll"
#r "../packages/Newtonsoft.Json.6.0.3/lib/net45/Newtonsoft.Json.dll"
open Nessos.FsPickler
open Nessos.FsPickler.Json
open Nessos.FsPickler.Combinators
open System.IO
let res y =
let jsp = FsPickler.CreateJson()
@mastoj
mastoj / Deserialized types to json
Created June 12, 2014 17:05
Deserialized types to json
{
"commands": [
"Folkeregister.Contracts.Commands.CreatePerson",
"Folkeregister.Contracts.Commands.AddAdressToPerson"
],
"types": [
{
"$type": "Folkeregister.Web.TypeDeserialization.ObjectModel, Folkeregister.Web",
"type": "Folkeregister.Contracts.Commands.CreatePerson",
"name": "CreatePerson",
@mastoj
mastoj / OctoDeployScript.ps1
Created December 2, 2013 09:00
Script for automating deployment using the v 2.0 api of Octopusdeploy
Param([string]$ServerUrl,
[string]$ProjectName,
[string]$EnvironmentName,
[string]$Version,
[string]$RootUrl,
[string]$OctoApiKey)
Write-Host "Server url: $ServerUrl"
Write-Host "Project name: $ProjectName"
Write-Host "Environment name: $EnvironmentName"
@mastoj
mastoj / Program.cs
Created November 12, 2013 15:48
Simple Nowin app with middleware
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Threading.Tasks;
using Nowin;
namespace HelloNowin
{
using AppFunc = Func<IDictionary<string, object>, Task>;
@mastoj
mastoj / HelloOwin.cs
Last active April 30, 2018 15:38
Simple self hosted Hello World app using Owin.
namespace HelloOwin
{
using System;
using Microsoft.Owin.Hosting;
using Owin;
using AppFunc = System.Func<System.Collections.Generic.IDictionary<string, object>, System.Threading.Tasks.Task>;
class Program
{
static void Main(string[] args)
namespace Configurer
{
public static class SomeThing
{
public static string SomeString { get; set; }
}
public class PreApplicationStartCode
{
public static void Start()
@mastoj
mastoj / gist:6375018
Created August 29, 2013 07:09
nslookup resharper-plugins.jetbrains.com
Non-authoritative answer:
Name: waws-prod-db3-003.cloudapp.net
Address: 137.135.129.175
Aliases: resharper-plugins.jetbrains.com
resharper-plugins.azurewebsites.net
waws-prod-db3-003.vip.azurewebsites.windows.net
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CQRSDemo
{
@mastoj
mastoj / app.js
Last active December 19, 2015 09:38
Issue 2031 of emberjs
App = Ember.Application.create();
App.Router.map(function() {
// put your routes here
});
App.IndexRoute = Ember.Route.extend({
model: function(){
return App.IndexModel.create();
}