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 / talks.md
Last active December 12, 2015 06:19
Sketching out some ideas for NDC talk submissions. Feel free to leave a comment.

Hacking on Portable Class Libraries For Fun and Profit

Do you do cross-platform development on .NET? Are you sick of #ifdef hell or maintaining duplicate codebases which do essentially the same thing? Let me show you Portable Class Libraries. They're neat.

Things to cover:

  • why on earth should i care?
@shiftkey
shiftkey / app.py
Last active December 12, 2015 03:19
A bit rusty but here's a script to parse a collection of KML files and pull out all the interesting data
from xml.dom.minidom import parse
def get_label(node):
name = node.getElementsByTagName('name')[0]
label = name.firstChild.nodeValue
return label
def get_coords(node):
coordinates = node.getElementsByTagName('coordinates')[0]
coords = coordinates.firstChild.nodeValue
@shiftkey
shiftkey / MainWindow.cs
Last active December 12, 2015 01:08
Musing on supplying sample data in a non-sucky way (with ReactiveUI)
using ReactiveUI;
namespace WpfApplication1
{
public class DesignMainViewModel : MainViewModel
{
public DesignMainViewModel()
{
UserName = "shiftkey";
}
@shiftkey
shiftkey / gist:4661947
Last active December 11, 2015 21:19
Formatting strings - looks to be same between XAML and regular .NET code
using System.Windows;
using System.Windows.Data;
using Xunit;
namespace ConsoleApplication2
{
public class Test
{
DependencyObject dObj = new DependencyObject();
@shiftkey
shiftkey / Repro.cs
Last active December 11, 2015 12:18
Repro: DateTimeOffset support missing in ServiceStack.OrmLite.SqlServer (supported in SQL Server 2008+)
using System;
using NUnit.Framework;
using ServiceStack.OrmLite.SqlServer;
namespace ServiceStack.OrmLite.SqlServerTests
{
[TestFixture]
public class DateTimeOffsetTests
{
// NOTE: ISO 8601 says no whitespace between time value and timezone parameter
@shiftkey
shiftkey / gist:4562167
Created January 18, 2013 03:42
Waste Collection Type Calculation Algorithm
EXAMPLE 1
IF the Collection Day (in WASTE_COLLECTION_DAYS dataset) is “WEDNESDAY EVEN”
THEN
The Household’s General Waste will be picked up every WEDNESDAY and
IF the current week is designated as an EVEN week (in WASTE_COLLECTION_WEEKS_REFERENCE_TABLE dataset)
@shiftkey
shiftkey / gist:4544405
Created January 16, 2013 03:22
Getting started with TPL
using System;
using System.Diagnostics;
using System.Threading.Tasks;
namespace PortableClassLibrary1
{
public class Class1
{
public Class1()
{
@shiftkey
shiftkey / gist:4472115
Created January 7, 2013 03:35
Want to clean up all the development apps you have deployed in your Windows 8 development environment? Change the -User parameter to your account and run this script. WARNING: It will delete data. It only looks for packages named with GUIDs, not apps you have installed from the Store. Use at own risk.
Get-AppxPackage -user zeus\brendan | Where-Object {$_.Name -match "[a-fA-F0-9]{8}-([a-fA-F0-9]{4}-)
{3}[a-fA-F0-9]{12}" } | Foreach-Object {Remove-AppxPackage $_.PackageFullName}
  • Chocolatey - $51k raised of $40k goal = 1,044 donors, $48.99 average

  • Read the Docs - $26k raised of $24k goal = 174 donors, $149 average

  • Ghost - £196k of £25k goal = 5236 donors, £37.50 average (USD $56.43 as at 2013-05-28)

  • Tokaido - $51k of $25k goal = 739 donors, $69.30 average

  • Mailpile - $163k of 100k goal = 3639 donors, $44.84 average

@shiftkey
shiftkey / git-for-windows-rc.md
Last active October 27, 2015 19:09
Git for Windows - Request for Beta Testers

Git for Windows - Beta Testers Guide

The Git for Windows team is currently testing their newest release candidates, which is a port of Git 2.3 to Windows. As this is a significant change, I've written up a guide for people who are interested in helping to test out things.

Recommended Setup

You can find the latest releases for Git for Windows over on the Releases page:

https://github.com/git-for-windows/git/releases