Skip to content

Instantly share code, notes, and snippets.

@mathiasbynens
mathiasbynens / appify
Created November 12, 2010 13:46 — forked from subtleGradient/appify
appify — create the simplest possible Mac app from a shell script
#!/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
@omarstreak
omarstreak / createAndSign.sh
Created January 18, 2013 01:41
Create and sign your safari extension file
XAR=path/to/xar/bin
BUILD_DIR=path/to/dir/with/cert/files
EXTENSION=your extension name
$XAR -czf $EXTENSION.safariextz --distribution $EXTENSION.safariextension
$XAR --sign -f $EXTENSION.safariextz --digestinfo-to-sign digest.dat --sig-size `cat $BUILD_DIR/size.txt` --cert-loc $BUILD_DIR/cert.der --cert-loc $BUILD_DIR/cert01 --cert-loc $BUILD_DIR/cert02
openssl rsautl -sign -inkey $BUILD_DIR/key.pem -in digest.dat -out sig.dat
$XAR --inject-sig sig.dat -f $EXTENSION.safariextz
rm -f sig.dat digest.dat
@mnaberez
mnaberez / 0xed.rb
Created May 1, 2013 17:49
Open a file in 0xED from the command line.
#!/usr/bin/env ruby
if ARGV[0]
filename = File.expand_path(ARGV[0])
abort "File not found: #{filename}" unless File.file?(filename)
else
abort "Usage: #{__FILE__} <filename>"
end
`osascript -e 'tell application "0xED" to activate'`
@wishfoundry
wishfoundry / gist:7036457
Last active April 1, 2022 05:18
Set OSX default text editor to sublime text 3 instead of TextEdit
defaults write com.apple.LaunchServices LSHandlers -array-add '{LSHandlerContentType=public.plain-text;LSHandlerRoleAll=com.sublimetext.3;}'
@pudquick
pudquick / parse_pbzx2.py
Created April 8, 2015 05:27
A pbzx stream decoder for the format found within Yosemite package payloads.
# v2 pbzx stream handler
# My personal writeup on the differences here: https://gist.github.com/pudquick/29fcfe09c326a9b96cf5
#
# Pure python reimplementation of .cpio.xz content extraction from pbzx file payload originally here:
# http://www.tonymacx86.com/general-help/135458-pbzx-stream-parser.html
#
# Cleaned up C version (as the basis for my code) here, thanks to Pepijn Bruienne / @bruienne
# https://gist.github.com/bruienne/029494bbcfb358098b41
import struct, sys

HomeKit Service and Characteristic UUIDs

Thanks to HAP-NodeJS

Service UUID
Accessory Information 0000003E-0000-1000-8000-0026BB765291
Air Quality Sensor 0000008D-0000-1000-8000-0026BB765291
Battery Service 00000096-0000-1000-8000-0026BB765291
Bridging State 00000062-0000-1000-8000-0026BB765291
@steventroughtonsmith
steventroughtonsmith / gist:52f0c6783446b6fc536e
Created January 17, 2016 06:49
NSExtensionSDK providers
AddressBookUI.framework
(
"com.apple.people-picker"
)
AudioToolbox.framework
(
"com.apple.AudioUnit",
"com.apple.AudioUnit-UI"
@guycalledseven
guycalledseven / manual-uninstall-wireshark.sh
Created March 6, 2017 12:10
Manually remove Wireshark leftovers MacOS
sudo rm -r /Applications/Wireshark.app
sudo rm -r /Library/Wireshark
sudo rm /Library/StartupItems/ChmodBPF
sudo rm /Library/LaunchDaemons/org.wireshark.ChmodBPF.plist
sudo rm /Library/Application\ Support/Wireshark/ChmodBPF/ChmodBF
sudo rm /Library/Application\ Support/Wireshark/ChmodBPF/org.wireshark.ChmodBPF.plist
sudo dscl . -delete /Groups/access_bpf
@shotahorii
shotahorii / 20171104_2.md
Last active March 27, 2023 20:53
(un)pivot on Presto

Pivot

Query
SELECT
  uid,
  kv['c1'] AS c1,
  kv['c2'] AS c2,
  kv['c3'] AS c3
FROM (
@rxwei
rxwei / ad-manifesto.md
Last active November 9, 2023 09:58
First-Class Automatic Differentiation in Swift: A Manifesto