Skip to content

Instantly share code, notes, and snippets.

View jmkelly's full-sized avatar

James Kelly jmkelly

  • Coffs Harbour, Australia
View GitHub Profile
@jmkelly
jmkelly / c#
Created July 12, 2011 23:54
Multiple responses based on request type
public class CountryModel
{
public string Code { get; set; }
public string Name { get; set; }
}
public class CountrieslistHandler
{
public IResult Get()
{
@jmkelly
jmkelly / C#
Created July 13, 2011 11:00
Select_Tag
<viewdata model="tinyweb.viewengine.tests.UserModel" />
<h1>${Model.ID}</h1>
<h2>${Model.Username}</h2>
<div>${SelectTag.For<countries>()}</div>
@jmkelly
jmkelly / HandlerTest
Created August 23, 2011 03:58
TinyWeb Handler Test
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;
using Midway.Mobile.Web.Handlers;
using NSubstitute;
using Midway.Infrastructure.Logging;
using Midway.Infrastructure.Mappings;
using Midway.Infrastructure.Services;
@jmkelly
jmkelly / C#
Created October 12, 2011 02:08
Tinyweb handling ajax post (not working)
using System;
using System.Collections.Generic;
using System.Web;
using tinyweb.framework;
using tinyweb.viewengine.spark;
using System.Text;
namespace Web.Handlers
{
@jmkelly
jmkelly / gist:5185327
Created March 18, 2013 06:04
Alternative syntax for creating toolbar
Instead of
var drawControl = new L.Control.Draw({
edit: {
featureGroup: drawnItems
}
});
How about
@jmkelly
jmkelly / Brand.cs
Last active December 15, 2015 12:19 — forked from luisrudge/Brand.cs
public class Brand : IBrand
{
public int Id { get; set; }
public string Name { get; set; }
public int? ParentBrandId { get; set; }
}
<configuration>
<configSections>
...
</configSections>
<razor disableAutoIncludeModelNamespace="false">
<assemblies>
<add assembly="MiniProfiler"/>
<add assembly="Nancy" />
</assemblies>
<namespaces>
@if (Midway.Web.Helpers.PageHelper.IsDebug() == false)
{
<script src="@Url.Content("~/assets/vendor/leaflet.draw.custom/examples/libs/leaflet-src.js")"></script>
<script src="@Url.Content("~/assets/js/build/built.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/assets/js/src/Midway.GeneralMapApplication.js")" type="text/javascript"></script>
}
else
{
<script src="@Url.Content("~/assets/vendor/leaflet.draw.custom/examples/libs/leaflet-src.js")"></script>
<script src="assets/js/lib/handlebars/handlebars-v1.1.2.js" type="text/javascript"></script>
# Boxstarter options
$Boxstarter.RebootOk=$true # Allow reboots?
$Boxstarter.NoPassword=$false # Is this a machine with no login password?
$Boxstarter.AutoLogin=$true # Save my password securely and auto-login after a reboot
# Basic setup
Update-ExecutionPolicy Unrestricted
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowFileExtensions -EnableShowFullPathInTitleBar
Enable-RemoteDesktop
Disable-InternetExplorerESC
#!/bin/bash
#First you update your system
sudo apt-get -y update && sudo apt-get -y upgrade
sudo apt-get -y install curl wget firefox
#Install Google Chrome
echo "Chrome"
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
sudo apt-get -y update