jEdit is my day-to-day editor. It works on every OS I use (primarily Windows at work and FreeBSD at home). With plugins, it provides every feature I need. It's open source [see note], easily extended, and it just works.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/sh | |
# | |
# git-ci | |
# | |
# Description: | |
# Does all the commands one normally has to do to "check in" updates | |
# to a branch in a centralized repository. | |
# | |
# Example: | |
# git-ci "Check-in comment goes here." development/features/SQUIRREL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/***************************************************************************** | |
diff.bsh | |
Allows jEdit to function as a two-way diff tool. | |
Note: You must have the JDiff plugin installed. | |
To configure an outside application to use jEdit as its diff tool, the | |
command is (assuming jedit is in your path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*---------------------------------------------------------------------------- | |
normalize | |
@param subject The subject string to normalize | |
@return The normalized version of the string | |
Normalizes a given string for use as a human-readable, but | |
machine-friendly string identifier. The normalization rules are: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Title</title> | |
<link rel="stylesheet" href="styles.css"> | |
<script src="script.js"></script> | |
</head> | |
<body> | |
I did a dumb thing when backing up a file server once. I transferred a bunch of huge tarballs to a Windows machine over FTP. Normally, when I'm at the console, I'm transferring between Unix machines, so I forgot to set the transfer mode to binary. I transferred a bunch of huge files in ASCII then deleted the disk to make way for the new server's OS.
Well, that was a Bad Thing^TM. After getting over the shock of losing nearly 20GB of backups, I set out to see if I could "un-ASCII" the files. It turned out to be quite easy. So, here's the code that saved the day...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
############################################################################## | |
# | |
# MTar.py | |
# | |
# Zac Hester | |
# 2011-12-22 | |
# | |
# This behaves similarly to Python's built-in tar support. However, this is | |
# a simplified library that writes extremely primitive tar files. The |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#============================================================================= | |
def hexdump( blob ): | |
""" | |
Returns a tabular string of hex values for a string. | |
@param blob Binary string to represent | |
@return String of hex values | |
""" | |
import math | |
length = len( blob ) | |
bytes = struct.unpack( '%dB' % length, blob ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/***************************************************************************** | |
PHP/GD Anti-aliasing, Proof of Concept | |
Zac Hester - 2011-06-28 | |
Just a small bit of code to see if it can be done, and what kind of | |
memory overhead is needed to pull off an arbitrary, geometry-agnostic | |
anti-aliasing that works with transparent images. | |
*****************************************************************************/ |