Skip to content

Instantly share code, notes, and snippets.

View timheuer's full-sized avatar
🚴‍♂️
https://twitter.com/timheuer

Tim Heuer timheuer

🚴‍♂️
https://twitter.com/timheuer
View GitHub Profile
POST https://api.teamsnap.com/v2/authentication/login HTTP/1.1
X-Teamsnap-User: <removed-for-gist>
X-Teamsnap-Password: <removed-for-gist>
Host: api.teamsnap.com
Content-Length: 0
HTTP/1.1 400 Bad Request
Server: nginx/1.4.5 + Phusion Passenger 3.0.21
X-Rack-Cache: invalidate, pass
Cache-Control: no-cache
JSON:
[
{
team: {
international_date: false,
is_coed: false,
team_name: "foo bar"
}
},
{
// http://msdn.microsoft.com/en-us/library/ms646301.aspx
[DllImport("user32.dll")]
internal static extern short GetKeyState(int keyCode);
[DllImport("user32.dll")]
static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);
internal static bool IsCapsLockOn()
{
return (KeyStateHelper.GetKeyState((int)VirtualKey.CapitalLock)) != 0;
@timheuer
timheuer / Person.cs
Created May 15, 2014 13:49
VMFormatted
public class Person
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string FullName
{
get { return string.Format("{0} {1}", FirstName, LastName);
}
@timheuer
timheuer / sqlitememorystore.cs
Created June 27, 2014 17:13
SQlite Memory Store
var dbPath = Path.Combine(Windows.ApplicationModel.Package.Current.InstalledLocation.Path, "somedb.db");
using (var db = new SQLite.SQLiteConnection(dbPath))
{
// set this to memory instead of directory
db.Execute("PRAGMA temp_store = memory;");
// do your other stuff
}
@timheuer
timheuer / FlowLayoutWithStickyHeaders.h
Created July 4, 2014 05:51
FlowLayoutWithStickyHeaders
//
// FlowLayoutWithStickyHeaders.h
// From: http://blog.radi.ws/post/32905838158/sticky-headers-for-uicollectionview-using
//
// Created by Tim Heuer on 7/3/14.
//
#import <UIKit/UIKit.h>
@interface FlowLayoutWithStickyHeaders : UICollectionViewFlowLayout
static void Main(string[] args)
{
string foo = string.Format("foo{0}", "bar");
}
@timheuer
timheuer / dynamic.xaml
Created April 10, 2012 15:52
dynamic type binding Metro
<Page
x:Class="Application141.BlankPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Application141"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
#if DEBUG
if (Debugger.IsAttached)
{
FirstFloor.XamlSpy.XamlSpyConnection.Current.Open("localhost", 4530);
}
#endif
@timheuer
timheuer / mainpage.xaml
Created April 23, 2012 18:41
LengthConverters
<Page.Resources>
<local:LengthConverter x:Key="lc" />
<local:LengthBoolConverter x:Key="lb" />
</Page.Resources>
<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<Grid.Resources>
<local:MyViewModel x:Key="MyVM" BoundText="{Binding Path=Text, ElementName=inputbox, Mode=TwoWay}" />
</Grid.Resources>
<StackPanel DataContext="{Binding Source={StaticResource MyVM}}">
<TextBox x:Name="inputbox" FontSize="24.667" Text="{Binding BoundText, Mode=TwoWay}" />