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
#Most useful for providing a consistent uid on machines accessing an NFS mount: | |
$ sudo find . -xdev -user <old-uid> -print -exec chown <new-uid> {} \; |
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
<!-- Use to include properties per OS --> | |
<property file="${antutil.includes}/${os.name}-${os.arch}.properties" /> |
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
# According to the manual page for ipconfig, this command appears to be unique to Mac OS X. | |
# The command will display a bunch of useful info, including: | |
# - server_identifier (ip): That's your DHCP server's IP address. | |
# - yiaddr: Your machine's IP address. | |
# - chaddr: Your machine's MAC address. | |
# - domain_name_server: Your domain name server(s). | |
ipconfig getpacket en0 |
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 bell length to zero for all applications | |
setterm -blength 0 |
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
# Append the above to a Clearsilver generated page URL for a structured view of the template data. | |
?hdfdump=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
# Installing Subversion for local use is general an easy install, but allowing remote access to your svn repository over SSH can be problomatic dependent upon your OS and the means taken to install. | |
# For Darwinports and Fink on OS X the install location has to be added to users $PATHs, but there are extra steps outlined here for use of the svn+ssh means of access: | |
# http://subversion.tigris.org/faq.html#ssh-svnserve-location | |
# A much easier alternate is to sym link the svn binaries to a place on the default PATH (used by the SSH login): | |
# For MacPorts | |
ln -s /opt/local/bin/sv* /usr/bin/ |
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
/* | |
Using as a benchmark the task of iterating over a live collection produced by getElementsByTagName. IE/Win, Gecko and Safari all agree as to the fastest means - use a while loop and store the live collection in a variable: | |
*/ | |
var i = 0, el, els = document.getElementsByTagName(nodeName); | |
while (el = els[i++]) { | |
// [...] | |
} |
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
/* | |
I wanted a table to allow the user to select a range of rows with a Shift+Click… The problem is that, by default, the browser will select the page’s text content. This isn’t something you’ll want to do very often but it is possible to get around this: | |
Firefox can do this from your CSS: | |
table { | |
-moz-user-select: none; | |
} | |
On the table element IE needs: |
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
<!-- | |
A quick code snippet to include the right XHTML DTD in your XSL generated output. This took me a bit of reseach to find out: | |
--> | |
<xsl:output | |
method="xml" | |
encoding="utf-8" | |
omit-xml-declaration="yes" | |
indent="no" | |
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" |
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
/* | |
A single regex to parse and breakup a full URL including query parameters and anchors e.g. | |
https://www.google.com/dir/1/2/search.html?arg=0-a&arg1=1-b&arg3-c#hash | |
*/ | |
Url.regex = /^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/; | |
url: RegExp['$&'], | |
protocol: RegExp.$2, | |
host: RegExp.$3, |
OlderNewer