This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
usage () | |
{ | |
echo "Usage:\nsh icons.sh standard_icon.pdf debug_icon.pdf" | |
exit 1 | |
} | |
# usage: iconize input/file.pdf some/output/path/file.png 256 | |
# where `256` is the size to generate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# exit early on errors | |
set -eu | |
# from: brew.sh, install homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# latest node via homebrew is borked, install 6.x instead | |
brew install node@6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
if [ "$#" -lt 0 ]; then | |
echo "Usage: pw 16 [lim]" | |
exit 1 | |
fi | |
if [ "$#" -gt 2 ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
import AVFoundation | |
import AVKit | |
import QuartzCore | |
import PlaygroundSupport | |
import AppKit | |
import CoreGraphics | |
import CoreImage | |
let playgroundView = NSView(frame: NSRect(x: 0.0, y: 0.0, width: 640.0, height: 480.0)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# this was created for an admittedly specialized purpose but has some neat settings i want to remember | |
palette="/tmp/palette.png" | |
cropped="/tmp/cropped.mp4" | |
width="275" | |
filters="fps=15,scale=${width}:-1:flags=lanczos" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# requires sudo | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off | |
/usr/libexec/ApplicationFirewall/socketfilterfw --add /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app/Contents/MacOS/Simulator | |
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate on |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import Cocoa | |
let caseLookup: [Character: Character] = [ | |
"a": "A", "b": "B", "c": "C", "d": "D", "e": "E", "f": "F", "g": "G", "h": "H", "i": "I", "j": "J", "k": "K", "l": "L", "m": "M", "n": "N", | |
"o": "O", "p": "P", "q": "Q", "r": "R", "s": "S", "t": "T", "u": "U", "v": "V", "w": "W", "x": "X", "y": "Y", "z": "Z" | |
] | |
extension Dictionary where Value: Equatable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
// http://xoshiro.di.unimi.it/xoshiro256starstar.c | |
protocol PseudoRandomNumberGenerator { | |
associatedtype ReturnValue | |
mutating func next() -> ReturnValue | |
} | |
struct Arc4Random: PseudoRandomNumberGenerator { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
# generate allowed_characters number_of_characters | |
generate() | |
{ | |
cat /dev/random | env LC_CTYPE=C tr -cd $1 | head -c $2 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat << EOF | |
########################################################### | |
# Workaround adb disconnecting issue on macOS Sierra | |
# | |
# More info: | |
# https://code.google.com/p/android/issues/detail?id=219085 | |
# credits to: hans...@meetme.com, vs...@google.com | |
########################################################### |