Latest 100 public snipts »
jmakeig's
snipts
showing 1-10 of 10 snipts
-
∞ Replace directory symlink
# Given symlink, target, replace it with a symlink the the directory, source # Tested only with directories, not sure how this would work for files # s - symbolic link # f - if the target exists, unlink it # h - do not follow target symlink, required for replacing a directory symlink ln -sfh source target
-
∞ Crate a *NIX-friendly disk image on Mac OS X
# image.iso: Output image file # Source/: Directory from which the image is built hdiutil makehybrid -o image.iso Source/
-
∞ ChromeFrame toggle
<meta http-equiv="X-UA-Compatible" content="chrome=1">
-
∞ Frequency of local names in a database
xquery version "1.0-ml"; declare namespace x = "http://www.w3.org/1999/xhtml"; (: CAUTION: This will be slow for even moderately sized data sets. :) let $MAX := 650 return <x:table style="width: 100%;"> <x:tr><x:th>#</x:th><x:th>Name</x:th><x:th>Document Occurrences</x:th></x:tr> { for $name at $i in distinct-values((//element()/local-name(.))) let $ct := count( distinct-values( xdmp:value( concat("//*[local-name(.)='",$name,"']/xdmp:node-uri(.)") ) ) ) order by $ct descending return <x:tr style="border-bottom: solid 1px black;"><x:td>{$i}</x:td><x:td>{$name}</x:td><x:td><x:div style="width: {floor(xs:float($ct div $MAX) * 320)}; background-color: #ccc;">{$ct}</x:div></x:td></x:tr> }</x:table>
-
∞ PUTting a file via WebDAV
# PUTs a document to a WebDAV server curl --digest -u user:pass -H "Content-Type:application/xml" -T local_file.xml http://hostname:9999/remote_location.xml
-
∞ SSH Tunnel
# Forwards local traffic on port 2222 to the remote appserver host on port 9999. # e.g. http://localhost:2222 ssh -N -p 22 user@sshserver -L 2222/appserver/9999
-
∞ CSS background transparency
background: rgba(0,0,0,0.2); /* R, G, B, Alpha */ /* IE 7 */ background:url("blah.png"); /* I’m not sure why this is necessary */ /* Hack the gradient filter to get the same effect. */ filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#33000000,endColorstr=#33000000); /*AARRGGBB: 00 - FF => 0 - 1, scale accordingly*/ zoom: 1; /* hasLayout */
-
∞ CSS border radius
border-radius: 0.8em; -webkit-border-radius: 0.8em; -moz-border-radius: 0.8em;
-
∞ IE conditional comment
<!--[if IE 6]> Special instructions for IE 6 here <![endif]--> [if lte IE 6] [if true]
-
∞ Embed audio HTML5 style
<audio src="/audio/BrokenBeatScarred.mp3" controls><a href="/audio/BrokenBeatScarred.mp3">Download song</a></audio>


