Skip to content

Instantly share code, notes, and snippets.

🖕
none of your business

Chris Zarate chriszarate

View GitHub Profile
@chriszarate
chriszarate / sort.php
Last active Oct 5, 2015
Fake good sorting for en-US
View sort.php
<?php
/*
* In 2013, locale-based sort is still broken or headache-inducing on many machines, and
* POSIX or C locales are the unassailable default in a shocking number of places. (For a
* fun exercise, try relying on LC_COLLATE for sorting in OS X.)
*
* This is a shameful PHP-based hack that mimics proper sorting for English using iconv
* transliteration. If doing things the WRONG WAY offends you, avert your eyes. However,
* this has worked for me in a pinch when I don’t have time to track down a box that has
View zip-epub.sh
zip -X my.epub mimetype
zip -rg my.epub META-INF -X \*.DS_Store
zip -rg my.epub OEBPS -x \*.DS_Store
@chriszarate
chriszarate / ip-report.sh
Created Jun 8, 2012
Show IP addresses in standard Apache log files
View ip-report.sh
awk '{ print $1}' /path/to/access.log | sort | uniq -c | sort -nr
@chriszarate
chriszarate / imgcat.sh
Created Jun 8, 2012
Concatenate images with ImageMagick
View imgcat.sh
# If you want to append images horizontally, use this command
convert image1.jpg image2.jpg image3.jpg +append result.jpg
# If you want to append them vertically, change the + to a -
convert image1.jpg image2.jpg image3.jpg -append result.jpg
# Source: http://snipplr.com/view/10360/
@chriszarate
chriszarate / repeated-character-domains.txt
Created May 8, 2012
Repeated-character .com domain name availability
View repeated-character-domains.txt
======== REPEATED-CHARACTER .COM DOMAIN NAME AVAILABILITY =======
1 10 20 30 40 50 63
a ..............................#.......#...........#..#..##..#..
b ............#.....#..#...###########.########.#########.######.
c .............#..#....######.#.#######...######################.
d .....................##.##.###########.############.##########.
e ...................###.#######################################.
f ...........#.#.....#.#...####.#.##.###..#############.########.
g .......................#.#.#.....##.####.####.################.
h ..................#.#...#.#.##################################.
You can’t perform that action at this time.