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 / branching.md
Last active August 29, 2015 13:57
Every Branching Model Is Terrible

It's only been recently that our version control systems have matured to a point where we have the freedom to think about how to collaborate with our colleagues. But we still make mistakes and suffer through bad life decisions. "Bollocks!" you might say.

Well, when was the last time you heard something like this?

  • "Version Control, you say? never heard of it"
  • "uh, what version am I supposed to be working from?"
  • "we don't use branches, they just get in the way"
  • "we're going to gate your checkins and review them"
  • "don't worry about it, just hit that merge button"
@shiftkey
shiftkey / list-pull-request-contributors.linq
Created June 4, 2014 14:35
octokit.net list off contributors who have had a pull requests merged into a repository
var client = new GitHubClient(new Octokit.ProductHeaderValue("NDC-Oslo"))
{
Credentials = new Credentials("some-username", "some-password")
};
// find all merged PRs
var filter = new PullRequestRequest() { State = ItemState.Closed };
var pullRequests = await client.Repository.PullRequest.GetForRepository("octokit", "octokit.net", filter);
Console.WriteLine("Pull Requests: " + pullRequests.Count);
@shiftkey
shiftkey / AsyncTests.cs
Last active August 29, 2015 14:06
implementing a custom awaiter to make Rx more functionally pure
using System;
using System.Reactive;
using System.Reactive.Linq;
using System.Threading.Tasks;
using Xunit;
namespace ClassLibrary3
{
public class AsyncTests
{
@shiftkey
shiftkey / SaveCrashDumps.reg
Created September 18, 2014 22:36
Enable Reporting Crash Dumps for GitHub.exe
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\GitHub.exe]
"DumpType"=dword:00000002
@shiftkey
shiftkey / talks.md
Last active August 29, 2015 14:07
random talk ideas for dddbrisbane

Git Black Belt Edition

Are you using Git via the command line? Want to learn some tricks or understand more about what Git is actually doing under the hood? This will be mostly live demos, because it's so much more fun to see this stuff in action.

I'd also like to make this session interactive - if you've got questions about Git you'd like to see answered, please file an issue here and I'll see if I can work the best ones into the talk: https://github.com/shiftkey/talks

Asynchronous Programming - Running with Scissors

TODO

@shiftkey
shiftkey / gist:770803
Created January 8, 2011 12:45
Thought - Simpler XAML Markup
# place to put click handlers
@Code Application.Views.MainView
# by default, textblocks use this style and do TextWrapping="Wrap"
@Default TextBlock Style="{DefaultFontStyle}" Wrap
# by default, Button uses this style
@Default Button Style="{DefaultButtonStyle}"
# tab indent represents child items
PhoneApplicationPage
Grid
@shiftkey
shiftkey / WP7 - Memory Profiling Hijinks
Created February 4, 2011 01:50
Investigating memory usage of a trivial Panorama-based WP7 application.
// Scenario:
// Start with default WP7 Panorama application, two tabs each with listbox
// Added child page with panorama control, two tabs each with listbox
// Two ViewModels (Main and Child), each has a list of 270+ items
// No relationship between the ViewModels. Lazy-loaded data in-memory
Main - OnNavigatedTo - ApplicationCurrentMemoryUsage: 8036352
Main - OnNavigatedTo - ApplicationPeakMemoryUsage: 8048640
Main - Loaded - ApplicationCurrentMemoryUsage: 39870464
@shiftkey
shiftkey / Memory Usage for WP7 App
Created February 5, 2011 03:37
A longer running test for navigating between two screens of a WP7 app
Main - OnNavigatedTo - ApplicationCurrentMemoryUsage: 8036352
Main - OnNavigatedTo - ApplicationPeakMemoryUsage: 8048640
Main - Loaded - ApplicationCurrentMemoryUsage: 39862272
Main - Loaded - ApplicationPeakMemoryUsage: 39899136
Main - OnNavigatedFrom - ApplicationCurrentMemoryUsage: 51990528
Main - OnNavigatedFrom - ApplicationPeakMemoryUsage: 52760576
Child - OnNavigatedTo - ApplicationCurrentMemoryUsage: 51990528
// here's the C# code we have to use
namespace Application
{
public class Factory
{
public T Get<T>(string parameter) where T : Proxy
{
return default(T);
}
@shiftkey
shiftkey / ObservableCollection Overloads
Created April 19, 2011 11:18
Comparing the behaviour between IEnumerable<T> and List<T>
public ObservableCollection(IEnumerable<T> collection)
{
this._monitor = new SimpleMonitor<T>();
if (collection == null)
{
throw new ArgumentNullException("collection");
}
this.CopyFrom(collection);
}