A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
#!/bin/bash | |
XIBS="*.xib | |
app/*.xib | |
interfaces/*.xib | |
resources/*.xib" | |
for i in $XIBS | |
do | |
echo "Compiling `basename $i`..." | |
ibtool --compile resources/`basename -s .xib $i`.nib $i |
# | |
# Working with branches | |
# | |
# Get the current branch name (not so useful in itself, but used in | |
# other aliases) | |
branch-name = "!git rev-parse --abbrev-ref HEAD" | |
# Push the current branch to the remote "origin", and set it to track | |
# the upstream branch | |
publish = "!git push -u origin $(git branch-name)" |
# === Terminal.app === # | |
# Open new tab in terminal. | |
exec("osascript -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' > /dev/null 2>&1 ") | |
# Open directory | |
exec("osascript -e 'tell application \"Terminal\" to do script \"cd directory\" in selected tab of the front window' > /dev/null 2>&1 ") | |
# Open directory in new tab (this is better) | |
exec("osascript -e 'tell application \"Terminal\"' -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' -e 'do script with command \"cd directory && clear\" in selected tab of the front window' -e 'end tell' > /dev/null 2>&1") |
TADA, it’s `hexdump -v -e '64/1 "%02x" "\n"' < /dev/hidraw3` | |
No idea what the first byte is… but I’m going to assume its for device ID for the many users that are connected, but it probably has to be set by the connected machine? | |
01ff777f7f0800aa0000435dfdf1ff14000200c5ff0721150300000000001b000001fc9133a32990880428008000000080000000008000000080000000008000 | |
↑↑↑↑ | |
left stick, value, first field is horz (00 left), second field is vertical (00 top) | |
017f80ff61080064000059f2fdfffffbff0e00d107081e9bf600000000001b0000018e94b1b00690880428008000000080000000008000000080000000008000 | |
↑↑↑↑ |
# Customize BASH PS1 prompt to show current GIT repository and branch. | |
# by Mike Stewart - http://MediaDoneRight.com | |
# SETUP CONSTANTS | |
# Bunch-o-predefined colors. Makes reading code easier than escape sequences. | |
# I don't remember where I found this. o_O | |
# Reset | |
Color_Off="\[\033[0m\]" # Text Reset |
Attempting to get React Native to work on watchOS 2, starting with trying to get just UIKit working like @steventroughtonsmith: http://blog.steventroughtonsmith.com/post/128957959685/native-uikit-apps-on-apple-watch
The 'ActualWatchApp' framework target is linked to React Native headers via Cocoapods; currently just trying to get the 'PlainWatchApp' framework target (which isn't linked to React Native) working.
#!/usr/bin/env python | |
############################################################################### | |
# Wifi Kill # | |
# Robert Glew # | |
# https://github.com/roglew/wifikill # | |
# This python script can be used to kick anyone or everyone off of your wifi # | |
# network. The script must be run as sudo in order to send the required # | |
# packets. Have fun. # | |
############################################################################### |
// Returns a random Emoji 🌿 | |
extension String{ | |
func randomEmoji()->String{ | |
let range = 0x1F601...0x1F64F | |
let ascii = range.startIndex + Int(arc4random_uniform(UInt32(range.count))) | |
let emoji = String(UnicodeScalar(ascii)) | |
return emoji | |
} | |
} |