Skip to content

Instantly share code, notes, and snippets.

View geoff-nixon's full-sized avatar

Geoff Nixon geoff-nixon

View GitHub Profile
-- 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:
#!/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
@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
@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
#!/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
#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
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/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 / 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
@geoff-nixon
geoff-nixon / dhcpd.conf
Created March 23, 2017 23:36 — forked from robinsmidsrod/dhcpd.conf
Booting an Apple Mac into iPXE using simulated Apple Boot Server on ISC DHCPD
next-server 10.0.3.2;
if ( substring(option vendor-class-identifier, 0, 9) = "AAPLBSDPC"
and substring(option vendor-class-identifier, 10, 4) = "i386" ) {
# This needs to be there to tell the client we're an Apple boot server
option vendor-class-identifier "AAPLBSDPC";
# Normally the client asks for a list, we respond, they tell us what we want,
# then we send a select back with the information of that image.
# This skips all that and forces the select down to the client.
option vendor-encapsulated-options 01:01:02;
# Use ipxe.efi for native drivers, or snponly.efi for underlying UNDI