Skip to content

Instantly share code, notes, and snippets.

@zhester
zhester / shell.py
Created May 14, 2013 13:20
Python Shell Script
#!/usr/bin/env python
"""
A Shell Script
"""
__version__ = '0.0.0'
@zhester
zhester / basic.html
Created May 14, 2013 13:33
XHTML Basic
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>template</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
</body>
@zhester
zhester / chpy.py
Created May 14, 2013 13:48
Changes the default Windows Python interpreter for the ".py" file association. This is helpful when you have to work in a Windows environment with a wide variety of Python installations, but still like the convenience of executing scripts using the script's file name.
#*******************************************************************************
# chpy.py
# Zac Hester <zac.hester@gmail.com>
# 2012-08-07
#
# Change the Windows file association for .py to a given Python interpretor.
#
# For usage examples, type:
# chpy.py help
#
@zhester
zhester / starter.html
Created May 14, 2013 13:36
XHTML Starter
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<title>template</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<link rel="stylesheet" type="text/css" href="style.css"/>
<script type="text/javascript" src="script.js"></script>
</head>
<body>
@zhester
zhester / starter.css
Last active December 17, 2015 07:49
CSS Starter
/* Core Tag Styles */
body {
margin: 0;
padding: 0;
font: 10pt/130% Verdana,Geneva,sans-serif;
color: #000000;
background-color: #FFFFFF;
}
h1, h2, h3, h4, h5, h6 {
margin: 0.5em 0;
@zhester
zhester / Makefile
Created May 14, 2013 15:44
Simple drop-in gmake Makefile for stand-alone C projects that build with gcc.
##############################################################################
# Makefile
#
# Note: This assumes you have at least one header (.h) file in your project.
# If that is not the case, remove the "*.h" dependency from the rule to build
# object files. Or, just start using headers like a normal person.
##############################################################################
# Basic compile environment settings
CC = /usr/bin/gcc
@zhester
zhester / svn-prop-ignore
Created May 14, 2013 16:06
SVN Ignore File
# svn propedit svn:ignore .
build
debug
release
*.sdf
*.suo
*.vcxproj.user
*.opensdf
Debug
Release
@zhester
zhester / propscrub.py
Created June 25, 2013 18:48
Properties configuration file scrubber. Can be used to help synchronize configuration files between computers. I use this to update my jEdit configuration files between all my computers. There are some settings that I can't share (e.g. the proxy settings on my work PC), and some settings I'd like to preserve per PC. This handles all that, and al…
#!/usr/bin/env python
##############################################################################
#
# propscrub.py
#
# usage:
# propscrub.py -h
#
# Properties configuration file scrubber. Sorts and removes entries from a
# configuration file. It can remove top-level entries, as well as specific
@zhester
zhester / fill_vertical.js
Last active December 19, 2015 01:48
A function to cause any HTML element to fill the left-over vertical space of a reference element. This is handy at making UI elements that resize with the browser window.
/**
* fill_vertical
* Modifies an element's height to completely fill the remaining vertical
* space of a reference element. If the reference element happens to be the
* document element, the target element will fill the remainder of the
* viewport.
*
* @param elem The target element to resize
* @param relem The reference element to attempt to fill
* @param bounce Optional amount of margin below the target element
@zhester
zhester / dbg.js
Last active December 19, 2015 19:08
Function for adding a very primitive debug console to any page for development.
/**
* dbg
* Debug message printer. Drop-in debug console.
*
* @param message Message to display in console
*/
function dbg( message ) {
var ul = document.getElementById( 'message' );
if( ul == null ) {
ul = document.createElement( 'ul' );