Skip to content

Instantly share code, notes, and snippets.

@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'`
@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
@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