Skip to content

Instantly share code, notes, and snippets.

View curtismitchell's full-sized avatar

Curtis Mitchell curtismitchell

View GitHub Profile
@curtismitchell
curtismitchell / XamlWindow.boo
Created May 22, 2011 20:57
Boo/WPF application that loads external xaml
import System
import System.Windows from PresentationFramework
import System.Windows.Markup from PresentationFramework
import System.IO
class XamlWindow(Window):
def constructor(name):
load_xaml(name)
def load_xaml(name):
@curtismitchell
curtismitchell / XamlWindow.py
Created May 22, 2011 21:26
Loading external xaml file with IronPython
import clr
clr.AddReference("PresentationFramework")
clr.AddReference("PresentationCore")
from System.Windows import Window, Application
from System.Windows.Markup import XamlReader
from System.IO import File, Path
class XamlWindow(Window):
def __init__(self, name):
@curtismitchell
curtismitchell / gist:985915
Created May 22, 2011 21:30
Xaml that can be loaded by Boo or IronPython
<StackPanel
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Label Content="Hello World" />
<Button Content="Clickable" />
</StackPanel>
@curtismitchell
curtismitchell / calendar.htm
Created October 11, 2011 20:46
Html/JS/Css Calendar
<html>
<head>
<title>Calendar Test</title>
<style>
body { width: 320; height: 480; margin: 20, auto; }
#calWrapper { width: 100%; margin: 0 5; border: 1px solid #ccc; }
.dayCell { width: 40px; height: 40px; font-size: 11px; vertical-align: top; text-align: right; background-color: aliceblue;}
.dayHeader {
width: 40px;
@curtismitchell
curtismitchell / SlugExtension.cs
Created August 24, 2012 20:26
Turns a string into a url-friendly slug
/// <summary>
/// Represents a string as a url-friendly string
/// </summary>
static class SlugExtension
{
static public string ToSlug(this string unslugged)
{
var result = new Regex(@"[~`!@#\$%\^&\*\(\)_\+=\.><,\[\]{}]").Replace(unslugged, "");
result = new Regex(@"[\s]+").Replace(result, "-");
return result.ToLower();
@curtismitchell
curtismitchell / dabblet.css
Created April 4, 2013 11:44
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.classname {
box-shadow:inset 0px 1px 0px 0px #ffffff;
background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6) );
background:-moz-linear-gradient( center top, #ffffff 5%, #f6f6f6 100% );
filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6');
background-color:#ffffff;
@curtismitchell
curtismitchell / HttpContextStub.cs
Last active December 19, 2015 02:08
HttpContextStub for NET
// taken from Brad Wilson's blog: http://bradwilson.typepad.com/blog/2010/07/testing-routing-and-url-generation-in-aspnet-mvc.html
public class HttpContextStub : HttpContextBase
{
HttpRequestStub _request;
HttpResponseStub _response;
public HttpContextStub(string appPath = "/", string requestUrl = "~/")
{
_request = new HttpRequestStub(appPath, requestUrl);
@curtismitchell
curtismitchell / Constraint for workspaces
Last active December 19, 2015 10:29
MVC route constraint that does not match a set of words (with help from http://stackoverflow.com/questions/6277022/regex-not-matching-a-list-of-words)
/* must come before the default route (if still being used)
allows for routes like .../mycompany/projects/index/1
uses the constraint to make sure system controller names can co-exist with workspace names
*/
routes.MapRoute(
"Workspace",
"{workspace}/{controller}/{action}/{id}",
@curtismitchell
curtismitchell / Gherkin.md
Created March 13, 2014 23:09
Feature, User Story, Scenario authoring guidelines

#Gherkin Guidelines to documenting features, user stories, and scenarios using Gherkin, a business specification language.

In some projects, we will use Gherkin to communicate about features. Gherkin is a business-friendly language that is intended to ease communication between technical resources and project stakeholders.

##Feature A feature is a description of a key system function that delivers value to one or more stakeholders and/or end users.

##User Story A user story is a standard way of describing a feature in a matter that:

@curtismitchell
curtismitchell / Apple WWDC 2014.md
Last active August 29, 2015 14:02
Apple WWDC 2014

#Notes from the keynote

##OS X Yosemite

  • Master salesmanship of Windows 7 Aero-like effect on the windows
  • Great new layouts for included apps like Calendar and iMessages
  • Spotlight takes the utility out of tools like QuickSilver and Alfred
  • Spotlight is "Google Search on the desktop" leaving the user less of a reason to launch a web browser
  • Spotlight is a user-behavior-changing-feature in that users will use the web browser less (as a starting point for research)

##iCloud