Skip to content

Instantly share code, notes, and snippets.

@wheresalice
wheresalice / startingkey.py
Created October 26, 2010 13:49
Should let us pass the first key press to a Python wx grid. Currently the first key press is lost as it is used to enable editing of the grid.
def StartingKey(self, evt):
"""
If the editor is enabled by pressing keys on the grid, this will be
called to let the editor do something about that first key if desired.
"""
self.log.write("MyCellEditor: StartingKey %d\n" % evt.GetKeyCode())
key = evt.GetKeyCode()
ch = None
if key in [ wx.WXK_NUMPAD0, wx.WXK_NUMPAD1, wx.WXK_NUMPAD2, wx.WXK_NUMPAD3,
wx.WXK_NUMPAD4, wx.WXK_NUMPAD5, wx.WXK_NUMPAD6, wx.WXK_NUMPAD7,
@wheresalice
wheresalice / .htaccess
Created February 25, 2011 15:56
webfont .htaccess rules
# ----------------------------------------------------------------------
# Webfont access
# ----------------------------------------------------------------------
# allow access from all domains for webfonts
# alternatively you could only whitelist
# your subdomains like "sub.domain.com"
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
@wheresalice
wheresalice / microsoft.html
Created March 1, 2011 21:09
Microsoft EES License cost Calculator
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" >
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Microsoft EES License cost Calculator</title>
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/themes/ui-lightness/jquery-ui.css">
@wheresalice
wheresalice / doorbell.feature
Created March 22, 2011 12:35
Feature requirements for Howduino Leeds Workshops
Feature: doorbell alert
In order to be alerted to people wanting access to my place
As a worried tenant
I want to be alerted to people ringing the doorbell when not at home
Scenario: Alert by phone
Given I have everything set up correctly
When I am away from home
And somebody rings the doorbell
Then I want a group of people to be alerted by phone
@wheresalice
wheresalice / gist:883191
Created March 23, 2011 14:36
Arduino Redis client - pushes a message to a Redis list
#include <SPI.h>
#include <Ethernet.h>
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 2, 10 }; // this is the ip within my lan
byte gateway[] = { 192, 168, 2, 254 }; // neccessary to get access to the internet via your router
byte subnet[] = { 255, 255, 255, 0 };
byte server[] = { 192, 168, 2, 50 }; // Redis Server
String list = "jobs";
String message = "hello world";
@wheresalice
wheresalice / Definition.xml
Created March 24, 2011 16:06
Blueprint CSS Grid Definition for Evolus Pencil. Zip this file and import as a public stencil collection.
<Shapes xmlns="http://www.evolus.vn/Namespace/Pencil"
xmlns:p="http://www.evolus.vn/Namespace/Pencil"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="Blueprint_CSS.Icons"
displayName="Blueprint CSS"
description="Blueprint CSS Grid"
author="Alice Kaerast"
url="http://blueprintcss.org/">
@wheresalice
wheresalice / Blink.cpp
Created March 26, 2011 11:37
Arduino Blink avoiding the delay function which appears terribly broken on my system
@wheresalice
wheresalice / gist:889119
Created March 27, 2011 10:50
Arduino Webclient with static IPs - connects to Sinatra with a ping, should get a pong back
#include <SPI.h>
#include <Ethernet.h>
// Enter a MAC address and IP address for your controller below.
// The IP address will be dependent on your local network:
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192,168,1,3 };
byte server[] = { 192,168,1,2 };
String request = "GET /ping?q=123 HTTP/1.0";
@wheresalice
wheresalice / dotcloud_build.yml
Created April 4, 2011 14:34
Tech demo of Faye/NodeJS/Jade pubsub
www:
requirements:
- faye
- jade
@wheresalice
wheresalice / app.rb
Created April 16, 2011 19:42
Extending Nesta using Sinatra
module Nesta
class App
get '/ping' do
'pong'
end
end
end