Skip to content

Instantly share code, notes, and snippets.

View morgant's full-sized avatar

Morgan Aldridge morgant

View GitHub Profile
#!/bin/bash
# get the Mac OS X version
version_major=$(sw_vers -productVersion | cut -d . -f 2)
#version_minor=$(sw_vers -productVersion | cut -d . -f 3)
interpreter=''
# 10.7.x now has no 32-bit only version of Perl included, so we
# need to set Perl's prefer-32-Bit default
if [ $version_major -eq 7 ]; then
@morgant
morgant / mime2mdwn
Created April 18, 2011 01:56
Convert MIME format wiki export (developed for PhpWiki exports) to Markdown
#!/bin/bash
#
# mime2mdwn - Convert MIME format wiki export (developed for PhpWiki exports) to Markdown
#
# globals
debug=false
# the actual heavy lifting
@morgant
morgant / google_convert_currency.php
Created February 26, 2011 03:31 — forked from SeanJA/google_convert_currency.php
Caching currency conversion using Google Calculator.
<?php
$currencyCache = array();
/**
* Looks for unquoted keys in a json string and fixes them ie: {a:"b"} => {"a":"b"}
* @param string $string A json string that is suspect
* @return string A valid json string
*/
function fix_json($string){
@morgant
morgant / clipcat
Created December 8, 2010 20:10
My updates to David Kendall's original, and now part of tools-osx (https://github.com/morgant/tools-osx).
#!/usr/bin/perl -w
#
# clipcat - Concatenate and print Text Clippings.
#
# v0.1 2010-11-18 - David Kendal <https://gist.github.com/705623>
# Initial version. Used with permission.
# v0.2 2010-12-08 - Morgan Aldridge <[email protected]>
# Now concatenates multiple text clippings. Usage instructions.
#