Skip to content

Instantly share code, notes, and snippets.

@mazuhl
mazuhl / gist:1054093
Created June 29, 2011 15:29
List all the files in a directory
find [foldername]/ -type f
@mazuhl
mazuhl / image_swapper.js
Created May 7, 2011 11:27
Clickable main images for Drop Dead catalogue
//Preload images ("yes" or "no"):
var preloadimg="yes"
//Set optional link target to be added to all images with a link:
var optlinktarget=""
//Optionally, change 1.0 and 0.7 below to affect Wipe gradient size and duration in seconds in IE5.5+:
var filterstring="progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=1.0 Duration=0.7)"
if (preloadimg=="yes"){
@mazuhl
mazuhl / google-closure-compiler-example.sh
Created April 22, 2011 11:05
TextMate Bundle command to compress Javascript
#!/usr/bin/env bash
cat <<'RUBYEOF' > /tmp/textmate-command-$$.rb
begin
require 'rubygems'
require 'closure-compiler'
true
rescue LoadError
false
@mazuhl
mazuhl / html-4.01-tag-test.html
Created April 8, 2011 15:41
HTML 4.01 tag test
<h1>HTML tag test</h1>
<p>HTML 4.01 tags, examples and what they look like.</p>
<h2>Text tags</h2>
<p>Paragraph with text</p>
<p>Paragraph with <b>bold text</b></p>
<p>Paragraph with <strong>strong text</strong></p>
<p>Paragraph with <i>italic text</i></p>
@mazuhl
mazuhl / gist:892798
Created March 29, 2011 17:19
Crop date and reformat
awk -F, '{x = substr($3,8); print $1","$2","20x","$3","$4","$5","$6 }' file.csv > output.csv
@mazuhl
mazuhl / gist:763382
Created January 3, 2011 11:43
Resize all JPEGs in directory
for i in `ls *.jpg`; do convert -resize 50% -quality 80 $i conv_$i; done
@mazuhl
mazuhl / gist:763377
Created January 3, 2011 11:38
I have a feeling I did this 3 months ago...
history | grep whatever
@mazuhl
mazuhl / gist:751694
Created December 22, 2010 16:09
Every third line starting from the first, second and third (using sed)
sed -n '1~3p' file.txt
sed -n '2~3p' file.txt
sed -n '3~3p' file.txt
@mazuhl
mazuhl / gist:750184
Created December 21, 2010 16:39
Print the first word from a file, get uniques, output everything except comment lines
awk '{print $1}' file.csv | sort | uniq | grep '^[^; ]' > output.txt
@mazuhl
mazuhl / gist:745686
Created December 17, 2010 20:50
Extract frames from animated gif
convert image.gif image_%d.gif