Skip to content

Instantly share code, notes, and snippets.

@hibri
hibri / Scraper.cs
Created May 14, 2011 11:07
Scraper
using System;
using System.Collections.Generic;
using System.Net;
using NUnit.Framework;
namespace Songkick
{
[TestFixture]
public class Scraper
{
@hibri
hibri / gist:1008889
Created June 5, 2011 11:40
Http Mocking
[Test]
public void Foo() {
IHttpEndpoint httpEndpoint = new HttpEndpoint()
.At(new Uri("Http://localhost:8080/api"))
.WithNewContext();
httpEndpoint
.Stub(x => x.Get("/"))
.Return("Index")
.OK();
@hibri
hibri / gist:2300074
Created April 4, 2012 10:01
SourceGear Diffmerge 3 way merge params for TortiseGit
--merge --result=%merged %mine %base %theirs --title1="Mine : %yname" --title2="Merged: %mname" --title3="Theirs : %tname"
@hibri
hibri / gist:2936617
Created June 15, 2012 14:01
See all the web requests a web app makes with Fiddler
<system.net>
<defaultProxy >
<proxy proxyaddress="http://localhost:8888" />
</defaultProxy>
</system.net>
@hibri
hibri / gist:2973309
Created June 22, 2012 15:04 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@hibri
hibri / gist:2973312
Created June 22, 2012 15:04
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@hibri
hibri / gist:2973316
Created June 22, 2012 15:05 — forked from axelav/gist:1839777
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt
@hibri
hibri / .gitignore
Last active December 14, 2015 13:09
_ReSharper*
*.user
*.suo
*.pidb
*.userprefs
obj
bin
Bin
logs
ndepend
"a" slist => {1,2};
"b" slist => {58, a[1]};
@hibri
hibri / test.cs
Created July 25, 2016 17:39
HttpMock PR
[Test]
public void Should_match_any_request_that_was_made_with_specific_query_params()
{
var queryParams = new Dictionary<string, string> { { "a", "a" } };
var stubHttp = HttpMockRepository.At(_hostUrl);
stubHttp.Stub(x => x.Get("/endpoint/handler"))
.Return("OK")
.OK();