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 / 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}
So after reading Justin's post I started to think about how to deal with these "intrusions":
### How can you add integrity checks into your app?
### How can an application detect tampering?
### So you get hacked - how can you mitigate this?
@shiftkey
shiftkey / gist:4143068
Created November 25, 2012 10:46
Example Privacy Policy
Adapted from http://www.nickhodge.com/blog/privacy-policy
Inform­a­tion Collected
Your IP addresses is recor­ded and logged every­where on the Inter­net. {{Author}} does not sell nor trade these logs.
Usage of Social Networks
Some applic­a­tions from {{Author}} may allow you to share inform­a­tion over social net­work ser­vices such as Face­book, Twit­ter, Win­dows Live and LinkedIn. Depend­ing on the social net­work and how you use the con­nec­tion, you choose to use the app in accord­ance with the pri­vacy set­tings you have set in your social net­work­ing account. You may be able to post inform­a­tion to your social net­work­ing account, includ­ing per­son­ally iden­ti­fi­able information.
@shiftkey
shiftkey / gist:4000304
Created November 2, 2012 11:17
Talk Submission: Windows 8 - Stuff you might have missed

Sick and tired of hearing about apps apps apps? Do you want to hear about something else? I want to talk about stuff you might have missed during all the chaos of the past couple of months. You may have heard of them, but I'll go into detail about why these things matter and why you should care. And don't worry, we'll have fun.

@shiftkey
shiftkey / gist:3986548
Created October 31, 2012 11:27
dddBrisbane Talk Submission: Cultural Learnings of DevOps for Make Benefit Glorious Developers

There's a movement going on in many software organisations about devops - aligning developers and operations teams to help improve interactions and ensure great success on projects. But there are many things that developers can do to make their lives easier, and that's the topic for this talk. I'll demonstrate some of the tips and tricks I've used on various projects, and talk about why you should think about doing the same. I'd also love to hear some ideas and insight from the audience on this topic.

Evolving subtopics:

  • "The Bus And You"
@shiftkey
shiftkey / MainWindow-2.xaml
Created September 20, 2012 12:45
Text alignment of TextBox
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Custom="http://metro.mahapps.com/winfx/xaml/controls" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:Custom1="http://metro.mahapps.com/winfx/xaml/shared" x:Class="TestAoo.MainWindow"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colours.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
@shiftkey
shiftkey / .gitconfig
Created September 16, 2012 11:14
Sample .gitconfig with aliases for fun and profit
[alias]
st = status
co = checkout
ci = commit
br = branch
df = diff
lp = log -p
com = checkout master
fe = fetch origin
hr = reset origin/master --hard