Skip to content

Instantly share code, notes, and snippets.

View shiftkey's full-sized avatar
🌴
Not checking notifications, for realsies

Brendan Forster shiftkey

🌴
Not checking notifications, for realsies
View GitHub Profile
@shiftkey
shiftkey / gist:8681919
Created January 29, 2014 04:37
Re-testing http://blogs.msdn.com/b/vancem/archive/2006/10/01/779503.aspx on a modern machine (VM inside a MBP)
# .NET Framework 2.0
Data units of msec resolution = 0.365714 usec
10 typeof(string) : count: 1000000 26.349 +- 4% msec
10 typeof(string).TypeHandle : count: 1000000 27.436 +- 4% msec
10 anObj.GetType() == type : count: 1000000 35.330 +- 2% msec
10 Type.GetTypeHandle(obj).Equals(tHnd) : count: 1000000 28.136 +- 3% msec
10 anObj.GetType() == typeof(string) : count: 1000000 2.254 +- 7% msec
10 (anObj is string) : count: 1000000 8.841 +- 4% msec
@shiftkey
shiftkey / HttpClientWithProxyAdapter.cs
Created January 13, 2014 16:00
Wireup a HttpClient with proxy support in Octokit.net
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
@shiftkey
shiftkey / magic.md
Created January 9, 2014 22:10
Git: reverting a revert using the reflog

Recovering from a bad revert

Open up Git Shell for your repository and type this command:

git reflog

This will show a list of recent actions that Git has performed against your repository:

@shiftkey
shiftkey / Program.cs
Last active January 2, 2016 08:59
A quick and dirty demonstration of Window in Rx
using System;
using System.Reactive.Linq;
namespace SlidingWindow
{
class Program
{
static void Main(string[] args)
{
var random = new Random();
@shiftkey
shiftkey / Shimmer.txt
Last active March 4, 2024 21:33
Example Logging from Shimmer
2013-08-22 | 08:11:11 PM +10 | INFO | App: Bootstrapper started
2013-08-22 | 08:11:14 PM +10 | WARN | POCOObservableForProperty: Shimmer.WiXUi.Views.WelcomeView is a POCO type and won't send change notifications, WhenAny will only return a single value!
2013-08-22 | 08:11:14 PM +10 | WARN | POCOObservableForProperty: NuGet.ZipPackage is a POCO type and won't send change notifications, WhenAny will only return a single value!
2013-08-22 | 08:11:15 PM +10 | WARN | POCOObservableForProperty: Shimmer.WiXUi.Views.InstallingView is a POCO type and won't send change notifications, WhenAny will only return a single value!
2013-08-22 | 08:11:16 PM +10 | INFO | App: Bootstrapper finishing
2013-08-22 | 08:11:32 PM +10 | INFO | App: Bootstrapper started
2013-08-22 | 08:11:34 PM +10 | INFO | App: Bootstrapper finishing
@shiftkey
shiftkey / talks.md
Last active December 20, 2015 22:09
Talk Ideas for NDC London

Reactive Extensions for Mere Mortals

The Reactive Extensions framework (Rx) is a collection of libraries to make it easy to work with asynchronous sources of data. But was it made just for academics and those who like to wear hypercolour shirts?

In this talk I'll run through:

  • what IObservable and IObserver are and how they differ to IEnumerable
  • how it differs from async/await - and where it's a better fit
  • explain some of the common patterns that work well with Rx
  • how desktop developers can use Rx (with ReactiveUI)
@shiftkey
shiftkey / view_history.sh
Created July 20, 2013 03:45
Display a rolling command history from zsh
rm ~/.zsh_history
clear
touch ~/.zsh_history
tail -f ~/.zsh_history | sed -e 's/^:[[:space:]][0-9]*\:0;//g' -e '/tail*/d' -e '/clear/d'
Different license terms apply to different file types:
- Source code files are governed by the MICROSOFT PUBLIC LICENSE (Ms-PL) (INCLUDED BELOW).
- Binary files are governed by MSDN CODE GALLERY BINARY LICENSE (INCLUDED BELOW).
- Documentation files are governed by CREATIVE COMMONS ATTRIBUTION 3.0 LICENSE (INCLUDED BELOW).
MICROSOFT PUBLIC LICENSE (Ms-PL)
This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.
@shiftkey
shiftkey / noted.md
Created June 27, 2013 02:47
Updating a Windows 8 Project to Windows 8.1

Library Project

  • <Project ToolsVersion="12.0" - was 4.0
  • <ProjectGuid>{DF7DEFA5-13DE-4B22-9D77-8817EB6C153A}</ProjectGuid> - was <ProjectGuid>{166FB620-192D-46A9-9F8D-5536C678AED0}</ProjectGuid>
  • New parameter: <TargetPlatformVersion>8.1</TargetPlatformVersion>
  • New parameter: <MinimumVisualStudioVersion>12</MinimumVisualStudioVersion>
  • <VisualStudioVersion>12.0</VisualStudioVersion> - was 11.0
@shiftkey
shiftkey / WebApplication45.vstemplate
Created May 29, 2013 03:27
Project Template Magic
<VSTemplate Version="3.0.0" xmlns="http://schemas.microsoft.com/developer/vstemplate/2005" Type="Project">
<TemplateData>
<Name Package="{39c9c826-8ef8-4079-8c95-428f5b1c323f}" ID="3008" />
<Description Package="{39c9c826-8ef8-4079-8c95-428f5b1c323f}" ID="3383"/>
<Icon Package="{39c9c826-8ef8-4079-8c95-428f5b1c323f}" ID="4701"/>
<TemplateID>Microsoft.Web.CSharp.WebApplication45</TemplateID>
<ProjectType>Web</ProjectType>
<ProjectSubType>CSharp</ProjectSubType>
<SortOrder>10</SortOrder>
<RequiredFrameworkVersion>4.5</RequiredFrameworkVersion>