Skip to content

Instantly share code, notes, and snippets.

@joewalnes
joewalnes / 1. web.xml
Created December 21, 2012 12:47 — forked from anonymous/MyCustomDecoratorSelector.java
Custom SiteMesh 3 configuration - selecting a decorator based on HttpSession.
<web-app>
<filter>
<filter-name>sitemesh</filter-name>
<filter-class>com.blah.MyCustomSiteMeshFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>sitemesh</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
</web-app>
@joewalnes
joewalnes / home-yet.py
Created December 14, 2012 03:12
Am I home yet?
#!/usr/bin/env python
"""A tiny script that polls your location on Google Latitude, and updates
the color of a Blink1 LED. http://shop.thingm.com/blink1/
Red = At work
Blue = At home
Green = On my way
Should work on Windows, OS-X and Linux. Requires Python 2.7 or later.
@joewalnes
joewalnes / example.html
Created November 1, 2012 21:01
TinyTest.js
<script src="THING_TO_TEST.js"></script>
<script src="tinytest.js"></script>
<script>
TinyTest.run('THING_TO_TEST.js', {
'some test name': function() {
this.assertEquals(1, 2);
},
@joewalnes
joewalnes / README.md
Created September 22, 2012 18:23
WebSocket Slide Server

Demonstrates a way to build an HTML slide deck and allow multiple browsers to all see slide changes at the same time, triggered by something externally (via an HTTP request). Uses WebSockets to for real time updates.

Instructions

  • Requires Python. Tested on 2.7. Runs on a Pi and any old Linux/OSX setup. Should work on Python 3 - maybe.
  • Install Tornado. You can use pip install tornado or download the tarball from http://www.tornadoweb.org/.
  • Copy slides.html and slide-server.py into the same directory.
  • Run python slide-server.py. Uses sensible defaults. --help for options.
  • Open http://localhost:54321/ in your browser. Recommend Chrome.
@joewalnes
joewalnes / redis.py
Created August 29, 2012 21:35
Microlibrary: Python Redis client
from telnetlib import Telnet
class RedisLiteClient:
"""
Super lightweight no-frills blocking Redis client that doesn't require any additional dependencies.
This is a microlibrary, designed for easy copy'n'paste into a project, where you don't want to
rely on pip/easy_install/etc.
Usage:
@joewalnes
joewalnes / shower-lock.scad
Created August 26, 2012 17:59
3D printable shower door lock.
// A 3D printable shower door safety device.
// See: http://www.thingiverse.com/thing:20805
// See: http://todayimade.co/items/joe-walnes-made-shower-door-safety-clip
// 2012, Joe Walnes, Creative Commons Attribution Share Alike, blah de blah.
// Render in http://openscad.org/
//$fn = 24; // Smooth, but very slow rendering
$fn = 12; // Faster!
// All dimensions in mm.
@joewalnes
joewalnes / brick.scad
Created January 10, 2012 01:55
Toy brick generator, for OpenSCAD
// resolution of arcs.
$fs = 0.2;
module brick(units_long, units_wide) {
// dimensions (adjust for different brick systems)
piece_length = 5;
piece_height = 6;
wall_thickness = 1;
blob_height = 1;
@joewalnes
joewalnes / test.pde
Created December 17, 2011 23:33
atmega32u4, leonardo, i2c and serial problem
#include "Wire.h"
#define DS1307_ADDRESS 0x68
struct DateTime {
int second;
int minute;
int hour;
int weekDay;
int monthDay;
@joewalnes
joewalnes / Makefile
Created November 22, 2011 17:51
NPM without NPM
# To find NPM dependencies, use http://search.npmjs.org/
NPM_DEPS += http://registry.npmjs.org/connect/-/connect-1.5.2.tgz
NPM_DEPS += http://registry.npmjs.org/mime/-/mime-1.2.2.tgz
NPM_DEPS += http://registry.npmjs.org/qs/-/qs-0.2.0.tgz
NPM_DEPS += http://registry.npmjs.org/websocket-server/-/websocket-server-1.4.04.tgz
node_modules: Makefile
@rm -rf $@
@mkdir -p $@
@set -e; for DEP in $(NPM_DEPS); do \
This my hilarious conversation, attempting to get a good cable price with Comcast.
Jessica: Hello, I'm a live product specialist. I specialize in setting up new digital services. How may I help you today?
You: hello, I'm trying to figure out which package i should go for to get the best internet speeds
Jessica: I would be happy to go over the details of our packages with you.
Jessica: Let's move this chat and make it a window of its own. That way, you'll still see this web page while we chat. Please click 'Move My Chat' to move it now.
Jessica: Thank you for moving the chat.
Jessica: Before we continue, may I ask if you're an existing Comcast customer?
You: no i'm not.. i'm just about to move into a new house
Jessica: The internet speed is the same in our packages, what varies is the TV options.