jq is useful to slice, filter, map and transform structured json data.
brew install jq
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
require "json" | |
require "typhoeus" | |
require "pp" | |
# MigrateRepo usage instructions: | |
# | |
# The way this is used at Airbnb for migrating from GitHub to GHE is by | |
# creating a separate organization with no members called "migration", | |
# adding that as the target organization, and then once the migration | |
# has finished, moving it over to the intended location. |
javascript: { | |
var color = null; | |
var c = $('canvas.sketchpad')[0]; | |
var swidth = 32; | |
var sheight = 32; | |
var emojiX = 0; | |
var emojiY = 0; | |
function changeColor(newColor) { |
#! /usr/bin/env bash | |
# shellcheck disable=SC2059 | |
set -euo pipefail | |
# Toggle all currently 'Active' network servcies (e.g., Wi-Fi, Ethernet | |
# connections, etc...) to "restart" them. We'll ignore any already 'Disabled' | |
# services, and toggle all of the others to 'Disabled' and then back to | |
# 'Enabled'. This has been found helpful when your VPN won't re-connect after | |
# undocking and re-docking your MacBook, for example. |
require "ostruct" | |
# A wrapper around a single ERB template that will bind the given Hash of values, | |
# making them available as local variables w/in the template. | |
class ErbNow < OpenStruct | |
# Render a given ERB +template+ string, binding the entries in the given +attrs+ Hash | |
# as local variables in the template, with the key as the variable name. | |
# | |
# @example | |
# |