Skip to content

Instantly share code, notes, and snippets.

View tbielawa's full-sized avatar
💭
bitmath!

Tim Bielawa tbielawa

💭
bitmath!
View GitHub Profile
(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
#
@tbielawa
tbielawa / OptionParser-vs-OptionGroup
Created March 1, 2011 05:21
I want option_lists for GroupParser
32
33 class Runner:
34 options_table = [
35 Option("-a", "--auth-endpoint", dest="auth_endpoint", action="store",
36 help="endpoint to support the remote user framework"),
37 Option("-c", "--config", action="store",
38 help="config file path"),
39 Option("-e", "--endpoint", action="store",
40 help="URL to nushus xmlrpc endpoint"),
41 Option("-f", "--force", action="store_true",
#!/usr/bin/ruby
class Builder
@rpm_build_command = ""
def initialize(package_name, version, mock_chroot, build_target)
@package_name = package_name
@version = version
@full_name = "#{@package_name}-#{@version}"
@mock_chroot = mock_chroot
@build_target = build_target

ansible-modules(5)

NAME

# This would be your top level "collector".
# It has a ".ans" extension so the application knows to apply special preprocessing rules to it.
# webroll-javaupdate.ans
include: roll-webservers.yaml
include: update-javaservers.yaml