Skip to content

Instantly share code, notes, and snippets.

View jongalloway's full-sized avatar

Jon Galloway jongalloway

View GitHub Profile
@jongalloway
jongalloway / VsCommands.vbs
Created February 25, 2012 10:14
Output VS Commands as Yaml
Sub GetAllCommandsAsYaml()
Dim cmd As Command
Dim ow As OutputWindow = DTE.Windows.Item(Constants.vsWindowKindOutput).Object
Dim owp As OutputWindowPane
Dim exists As Boolean
Dim i As Integer
Dim sArray() As String
sArray = New String() {}
@jongalloway
jongalloway / default.asp
Created June 14, 2012 16:57
Eric [redacted] loves Classic ASP
<html>
<body>
<% Response.Write(Date) %>
<!--#include file="aspUtils.asp"-->
</body>
</html>
@jongalloway
jongalloway / CreateAdminUser.cs
Created August 23, 2012 06:11
I wanted to create an administrative user in an MVC 4 tutorial using a drop in code file (just throw in App_Start folder and it'll create the user on first run). Normally I'd use WebActivator for PostApplicationStart, but I wanted to make this just a simp
using Mvc4SampleApplication.Filters;
using System.Web;
using System.Web.Security;
using WebMatrix.WebData;
[assembly: PreApplicationStartMethod(typeof(PreApplicationTasks), "Initializer")]
public static class PreApplicationTasks
{
public static void Initializer()
Add-type -AssemblyName office
$find = "SPEAKER"
$replace = "Jon Galloway"
function ReplaceText {
param(
[object]$shape,
[string]$find,
[string]$replace
)
@jongalloway
jongalloway / start480x800.1024.bat
Last active December 10, 2015 00:29
Generalized using %ProgramFiles(x86)% and %LOCALAPPDATA% so this will work on anyone's computer.
@echo off
"%ProgramFiles(x86)%\Microsoft XDE\8.0\xde.exe" -createDiffDisk "%LOCALAPPDATA%\Microsoft\XDE\dd.480x800.1024.vhd" -vhd "%ProgramFiles(x86)%\Microsoft SDKs\Windows Phone\v8.0\Emulation\Images\Flash.480x800.vhd" -name "Emulator WVGA" -memsize 1024
using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation.Media;
using Watch.Face.Common;
using Watch.Face.Scroll.Properties;
namespace Watch.Face.Scroll.WatchFace
{
class WatchFaceScroll:WatchFaceBase
@jongalloway
jongalloway / WatchFaceFonts.cs
Created June 19, 2013 09:49
Slightly modified watch from https://github.com/thestamp/AgentWatch/ to bring in a new font
using System;
using Microsoft.SPOT.Presentation.Media;
using Watch.Face.Common;
namespace Watch.Face.Fonts.WatchFace
{
class WatchFaceFonts:WatchFaceBase
{
private string GetRandomSmall(bool before)
@jongalloway
jongalloway / SampleEmulator.cs
Created June 19, 2013 11:10
Micro Framework Emulator - Updated Paint method with scaling
protected override void OnPaint(PaintEventArgs e)
{
// Paint the LCD control. Use the contents of the LCD if available;
// otherwise call through to the base class.
if (_bitmap != null)
{
// Synchonize access to the bitmap with the .NET Micro Framework
// thread.
lock (_bitmap)
{
@jongalloway
jongalloway / SampleEmulator
Created June 19, 2013 11:11
Sample Emulator - Original
protected override void OnPaint(PaintEventArgs e)
{
// Paint the LCD control. Use the contents of the LCD if available;
// otherwise call through to the base class.
if (_bitmap != null)
{
// Synchonize access to the bitmap with the .NET Micro Framework
// thread.
lock (_bitmap)
{
@jongalloway
jongalloway / Default.aspx
Last active December 21, 2015 04:09 — forked from DamianEdwards/Default.aspx
Fixed some obvious problems
<%@ Page Language="C#" AutoEventWireup="true" %>
<%@ Import Namespace="System.Threading" %>
<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
uint viewIndex = 0;
uint.TryParse(Request.QueryString["view"], out viewIndex);
views.ActiveViewIndex = (int)(viewIndex < views.Views.Count ? viewIndex : 0);