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
# From http://blog.macromates.com/2006/wrapping-text-with-regular-expressions/ | |
def wrap_text(txt, col = 80) | |
txt.gsub(/(.{1,#{col}})( +|$)\n?|(.{#{col}})/, | |
"\\1\\3\n") | |
end |
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
; One of my recent favorite pieces of Emacs configuration. The % command was one of the things I missed the | |
; most in Emacs, until I found this little gem. I modified it from its original source by adding | |
; previous-line and next-line to the list of commands. | |
; From http://www.emacswiki.org/emacs/ParenthesisMatching#toc4 | |
(defun goto-match-paren (arg) | |
"Go to the matching parenthesis if on parenthesis AND last command is a movement command, otherwise insert %. | |
vi style of % jumping to matching brace." | |
(interactive "p") | |
(message "%s" last-command) | |
(if (not (memq last-command '( |
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
# | |
# Sample cf3 implementation of "single copy nirvana" from | |
# http://cfwiki.org/cfwiki/index.php/Singlecopy_Nirvana | |
# | |
# Time-stamp: <[cf3-singlecopy.cf] modified by Diego Zamboni on Monday, 2010.08.23 at 01:44:19> | |
# | |
body common control | |
{ | |
bundlesequence => { "copyfiles" }; |
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
# Find all network interfaces that match a certain IP address. | |
# Time-stamp: <[netif_find.cf] modified by Diego Zamboni on Tuesday, 2010.08.24 at 01:53:03> | |
body common control | |
{ | |
bundlesequence => { "test" }; | |
} | |
bundle agent test | |
{ |
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
# Sets the RHS of configuration items in the file of the form | |
# LHS RHS | |
# If the line is commented out with #, it gets uncommented first. | |
# Adds a new line if none exists. | |
# The argument is an associative array containing v[LHS]="rhs" | |
# Based on set_variable_values from cfengine_stdlib.cf, modified | |
# by Diego Zamboni to use whitespace as separator, and to handle | |
# commented-out lines. | |
bundle edit_line set_config_values(v) |
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
files: | |
suse_9:: | |
"${sys.workdir}/bin" | |
perms => usystem("0700"), | |
copy_from => mycopy("${repository}/bin/suse_9"), | |
depth_search => urecurse("1"); |
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
vars: | |
"suffixes" slist => { "${sys.flavour}" }; | |
files: | |
"${sys.workdir}/bin" | |
perms => usystem("0700"), | |
copy_from => mycopy("${repository}/bin.${suffixes}"), | |
depth_search => urecurse("1"); |
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
"suffixes" slist => { "${sys.fqhost}", "${sys.domain}", "${sys.flavour}", | |
"${sys.ostype}", "${myarbitraryvariable}", "" }; |
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
; AutoHotKey configuration to open my Inbox in OneNote. | |
; To use this, change the file path to the path of the GTD notebook | |
; you want to use. You may also want to change the key to which it | |
; is assigned (I use Win-i). | |
#i::Run c:\Users\zambonid\Documents\OneNote Notebooks\GTD\INBOX.one |
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
# -*- coding: utf-8 -*- | |
""" | |
pygments.lexers.cfengine | |
~~~~~~~~~~~~~~~~~~~~~ | |
Lexer for cfengine3 policy files. Should probably be incorporated into other.py | |
Written by Diego Zamboni <[email protected]> | |
""" |
OlderNewer