Skip to content

Instantly share code, notes, and snippets.

View tbielawa's full-sized avatar
💭
bitmath!

Tim Bielawa tbielawa

💭
bitmath!
View GitHub Profile
With project 3 winding down it seemed appropriate to browse through the svn commits. Here's some notable messages to hopefully brighten your day.
"load this up and enjoy yourself."
"oh bloody hell"
"Well, this is going somewhere..."
"woot"
import java.text.DecimalFormat;
import java.util.Scanner;
public class Vote
{
//main method will collect data from the user and place it within arrays
public static void main (String[] args){
Scanner sc = new Scanner (System.in);
int row;
int col;
#!/usr/bin/make
clean:
find -regextype posix-extended . -maxdepth 1 \( -regex "^[.]?(.+)\~$$" -o -regex "./[.]?#.*#" \) -delete
#!/usr/bin/env python
import ldap
import re
from accounts import user
DEBUG = 1
def dn2uid(dn):
if "cn=" in dn or "uid=" in dn:
return user.dn2uid(dn)
(defun indent-buffer ()
"Correctly indent an entire buffer"
(interactive)
(backward-page)
(set-mark-command 0)
(forward-page)
(defun delete-trailing-whitespace-except-current-line ()
(interactive)
(let ((begin (line-beginning-position))
(end (line-end-position)))
(save-excursion
(when (< (point-min) begin)
(save-restriction
(narrow-to-region (point-min) (1- begin))
(delete-trailing-whitespace)))
(when (> (point-max) end)
(setq auto-mode-alist
(cons '("\\.\\(XML\\|xml\\|xsl\\|rng\\|xhtml\\)\\'" . nxml-mode)
auto-mode-alist))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(backup-directory-alist nil)
'(case-fold-search t)
;; This buffer is for notes you don't want to save, and for Lisp evaluation.
;; If you want to create a file, visit that file with C-x C-f,
;; then enter the text in that file's own buffer.
(defun insert-date ()
"Insert a time-stamp according to locale's date and time format."
(interactive)
(insert (format-time-string "%a, %e %b %Y, %k:%M" (current-time))))
(global-set-key "\C-cd" 'insert-date)
(defun indent-buffer ()
"Indents an entire buffer using the default intenting scheme."
(interactive)
@tbielawa
tbielawa / do_tags
Created March 1, 2011 01:20
a way to generate etags of all installed python libraries!!!
#!/bin/bash
# Originally written at: http://code.google.com/p/python-etags/
# You may need to augment your PYTHONPATH before this works.
#
# For example, for my locally checked out libraries:
# $ PYTHONPATH=/home/tbielawa/rhat/nushus/src/nushus_client
# $ PYTHONPATH=$PYTHONPATH:/home/tbielawa/rhat/nushus/src/nushus
# $ export PYTHONPATH
# $ do_tags
#