Skip to content

Instantly share code, notes, and snippets.

View geoff-nixon's full-sized avatar

Geoff Nixon geoff-nixon

View GitHub Profile
@geoff-nixon
geoff-nixon / osx-software-update-urls.txt
Created September 23, 2015 08:04 — forked from stefanschmidt/osx-software-update-urls.txt
URLs of the index files used by the software update client on OS X
10.3 (Panther):
https://swscan.apple.com/scanningpoints/scanningpointX.xml
10.4 (Tiger):
https://swscan.apple.com/content/catalogs/index.sucatalog
https://swscan.apple.com/content/catalogs/index-1.sucatalog
10.5 (Leopard):
https://swscan.apple.com/content/catalogs/others/index-leopard.merged-1.sucatalog
#!/bin/bash
# Convert a Github Flavored Markdown Syntax file to HTML
#
# The MIT License (MIT)
# Copyright © 2012 Evertton de Lima <e.everttonlima@gmail.com>
# http://evertton.mit-license.org/
# Stylesheet feature by Dan Untenzu <mail@pixelbrackets.de>
#
# Requirements: cURL (sudo apt-get install curl)
@geoff-nixon
geoff-nixon / flavor.rb
Last active August 29, 2015 14:06 — forked from ttscoff/flavor.rb
#!/usr/bin/ruby
# Convert a Markdown README to HTML with Github Flavored Markdown
# Github and Pygments styles are included in the output
#
# Requirements: json gem (`gem install json`)
#
# Input: STDIN or filename
# Output: STDOUT
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file
# cat README.md | flavor > README.html
@geoff-nixon
geoff-nixon / 0_reuse_code.js
Created March 27, 2014 02:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#!/usr/bin/env node #// -*- Mode: Node.js JavaScript; tab-width: 4; -*-
/*
---
url: http://gist.github.com/441101
name : safari-get-html
description : safari-get-html will rock your socks!
authors : Thomas Aylott
copyright : © 2010 Thomas Aylott
license : MIT
-- Adapted from these sources:
-- http://peterdowns.com/posts/open-iterm-finder-service.html
-- https://gist.github.com/cowboy/905546
--
-- Modified to work with files as well, cd-ing to their container folder
on run {input, parameters}
tell application "Finder"
set my_file to first item of input
set filetype to (kind of (info for my_file))
-- Treats OS X applications as files. To treat them as folders, integrate this SO answer:
require 'rubygems'
require 'rubygems/package'
require 'zlib'
require 'fileutils'
module Util
module Tar
# Creates a tar file in memory recursively
# from the given path.
#
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
@geoff-nixon
geoff-nixon / gitsvndiff
Last active May 30, 2016 14:23 — forked from katta/gitdiff-svnpatch.sh
Use 'git diff' to produce subversion style patches.
#!/bin/sh
svnstyle(){ sed -e "s/^diff --git [^[:space:]]*/Index:/" -e "s/^index.*/===================================================================/" -e 's/@@\(.*\)@@.*/@@\1@@/g' ;}
DIFFPARAMS='--no-prefix --ignore-space-at-eol --minimal'
git diff $DIFFPARAMS "$@" | svnstyle
#!/bin/bash
# Fallback base64 en-/decoder for systems that lack a native implementation
#
# @param ... - flags
which base64 &>/dev/null || {
# if even od is missing
which od &>/dev/null || od()
{
local C O=0 W=16