Skip to content

Instantly share code, notes, and snippets.


Will Sams WillSams

View GitHub Profile
WillSams / CSharp-Mode.xshd
Created Sep 24, 2012 — forked from marcusholmgren/CSharp-Mode.xshd
VibrantInk inspired syntax highligthing for C# in SharpDevelop
View CSharp-Mode.xshd
<?xml version="1.0" encoding="utf-8"?>
<!--This file was autogenerated by the #Develop highlighting editor.-->
<!--VibrantInk inspired syntax highligthing for C# in #Develop.-->
<SyntaxDefinition name="C#" extensions=".cs">
<Custom name="TypeReference" bold="false" italic="false" color="Pink" />
<Custom name="UnknownEntity" bold="false" italic="false" color="Yellow" />
<Default bold="false" italic="false" color="White" bgcolor="Black" />
<Selection bold="false" italic="false" color="White" bgcolor="#6897BB" />
<VRuler bold="false" italic="false" color="Pink" bgcolor="#E3E3E3" />
WillSams /
Created Oct 11, 2012
Quick And dirty example of IronPython using Dapper.NET (w/MySql backend and stored procedures)
View - Quick And dirty example of IronPython using Dapper.NET (w/MySql backend and stored procedures)
import System
import clr
from System.Collections import IDictionary
from System.Collections.Generic import IDictionary, IList
from System.Data import IDbConnection, IDbCommand, CommandType
WillSams /
Last active Jun 10, 2020
MonoGame w/ IronPython Example
import os, clr
from Microsoft.Xna.Framework import *
from Microsoft.Xna.Framework.Graphics import *
class App(Game):
def __init__(self): = GraphicsDeviceManager(self)
WillSams / ConfigProxy.cs
Created Oct 17, 2012
Configuration Helper file to use with Iron Python apps. Just compile it from the command-line.
View ConfigProxy.cs
// Taken modified:
// command line compile: csc /target:library /out:ConfigProxy.dll ConfigProxy.cs
// In IronPython, to load up your config file:
// import clr
// clr.AddReference('System.Core')
// clr.AddReference('System.Xml')
// clr.AddReference('System.Configuration')
WillSams / Notepad2.ini
Last active Oct 11, 2015
My Notepad2 settings
View Notepad2.ini
WillSams / gist:3933697
Created Oct 22, 2012 — forked from defnull/gist:1224387
Deploy a Bottle app on Heroku
View gist:3933697
mkdir heroku
cd heroku/
virtualenv --no-site-packages env
source env/bin/activate
pip install bottle gevent
pip freeze > requirements.txt
cat > <<EOF
import bottle
import os
import logging
import time
logger = logging.getLogger(__name__)
def useful():
logger.debug('Hello from webapplib!')
WillSams / gist:4945386
Last active Dec 13, 2015
Custom validators for use with jquery validate
View gist:4945386
jQuery.validator.addMethod("dateGreaterThan", function (value, element, params) {
if (!/Invalid|NaN/.test(new Date(value))) {
return new Date(value) > new Date($(params).val());
return isNaN(value) && isNaN($(params).val())
|| (Number(value) > Number($(params).val()));
}, '<br />Must be greater than {0}.');
jQuery.validator.addMethod('greaterThan', function (value, element, param) {
View ubuntu-server-django-guide.rst

Ubuntu Server Setup Guide for Django Websites

This guide is a walk-through on how to setup Ubuntu Server for hosting Django websites. The Django stack that will be used in this guide is Ubuntu, Nginx, Gunicorn and Postgres. I needed an example site for this guide you can use Django Base Site which is available on Github. For more useful information on Ubuntu server installs, please see the documentation here:

WillSams /
Last active Sep 28, 2020
Getting Postgres up & running
sudo bash -c "apt update && apt upgrade -y"
sudo bash -c "apt install curl ca-certificates gnupg"
wget --quiet -O - | sudo apt-key add -
. /etc/*release; OS=$ID
if [ "$OS" == 'ubuntu' ]; then
You can’t perform that action at this time.