Skip to content

Instantly share code, notes, and snippets.

-- csipttc_unisiwc_ctpttfwttc.app
-- Copy Selected Items Path To The Clipboard Unless Nothing Is Selected In Which Case Copy The Path To The Foremost Window To The Clipboard
try
tell application "Finder"
set selectedItem to (POSIX path of (the selection as alias))
set the clipboard to selectedItem
end tell
on error
try
tell application "Finder"
@kitschpatrol
kitschpatrol / Mock CMDeviceMotion
Created December 20, 2013 18:39
Inline real-world CMDeviceMotion sample object for unit testing.
CMDeviceMotion *deviceMotion = [NSKeyedUnarchiver unarchiveObjectWithData:[[NSData alloc] initWithBase64EncodedString:
@"YnBsaXN0MDDUAQIDBAUINzhUJHRvcFgkb2JqZWN0c1gkdmVyc2lvblkkYXJjaGl2ZXLRBgdUcm9v"
"dIABowkKL1UkbnVsbN8QEgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLl8QJmtD"
"TURldmljZU1vdGlvbkNvZGluZ0tleU1hZ25ldGljRmllbGRYXxAla0NNRGV2aWNlTW90aW9uQ29k"
"aW5nS2V5Um90YXRpb25SYXRlWl8QKWtDTURldmljZU1vdGlvbkNvZGluZ0tleVVzZXJBY2NlbGVy"
"YXRpb25aXxAja0NNRGV2aWNlTW90aW9uQ29kaW5nS2V5UXVhdGVybmlvbldfEBxrQ01Mb2dJdGVt"
"Q29kaW5nS2V5VGltZXN0YW1wXxAla0NNRGV2aWNlTW90aW9uQ29kaW5nS2V5Um90YXRpb25SYXRl"
"WF8QNWtDTURldmljZU1vdGlvbkNvZGluZ0tleU1hZ25ldGljRmllbGRDYWxpYnJhdGlvbkxldmVs"
"XxAja0NNRGV2aWNlTW90aW9uQ29kaW5nS2V5UXVhdGVybmlvblpfECprQ01EZXZpY2VNb3Rpb25D"
"b2RpbmdLZXlEb2luZ1lhd0NvcnJlY3Rpb25fECtrQ01EZXZpY2VNb3Rpb25Db2RpbmdLZXlEb2lu"
// Motor control code via http://itp.nyu.edu/physcomp/Labs/DCMotorControl
const int switchPin = 2; // switch input
const int motor1Pin = 3; // H-bridge leg 1 (pin 2, 1A)
const int motor2Pin = 4; // H-bridge leg 2 (pin 7, 2A)
const int enablePin = 9; // H-bridge enable pin
void setup() {
// set the switch as an input:
pinMode(switchPin, INPUT);
// Daniel Shiffman
// Tracking the average location beyond a given depth threshold
// Thanks to Dan O'Sullivan
// http://www.shiffman.net
// https://github.com/shiffman/libfreenect/tree/master/wrappers/java/processing
import org.openkinect.*;
import org.openkinect.processing.*;
// Showing how we can farm all the kinect stuff out to a separate class
// Processing Text to Speech
// Eric Mika, Winter 2010
// Tested on Max OS 10.6 only, possibly compatible with 10.5 (with modification)
// Adapted from code by Denis Meyer (CallToPower)
// Thanks to Mark Triant for the inspiring sample text
Process lastVoiceProcess;
String script = "cosmic manifold";
int voiceIndex;
int voiceSpeed;
@kitschpatrol
kitschpatrol / gist:9241609
Created February 27, 2014 00:11
LineAndShape2 Build
cd ~/Desktop
git clone [email protected]:lp-cma.lineAndShape2.git
cd lp-cma.lineAndShape2
git submodule update --init --recursive
cd LineAndShapeApps/LineAndShape
xcodebuild
open bin/LineAndShape.app
-- csipttc_unisiwc_ctpttfwttc.app
-- Copy Selected Items Path To The Clipboard Unless Nothing Is Selected In Which Case Copy The Path To The Foremost Window To The Clipboard
on makeAndCopyLinkFromPath(myPath)
if myPath starts with "/Volumes/" then
set dirStructure to ((characters 9 thru -1 of myPath) as string)
set strHTML to quoted form of ("<a style='font-family:helvetica' href=\"smb://Guest::@lp-vault" & dirStructure & "\">" & myPath & "</a>") --double :: bc otherwise it disappears?
--tell application "Finder" to display dialog strHTML
do shell script "echo " & strHTML & " | textutil -format html -convert rtf -stdin -stdout | pbcopy -Prefer rtf"
else
@kitschpatrol
kitschpatrol / xcode-build-number-generator.sh
Created May 9, 2014 14:34
xcode-build-number-generator.sh
#!/bin/bash
# Automatically updates the App's build number
# This script should be executed by Xcode before every build
# It should mutate only the built version of the app to keep merges clean.
# (E.g. the Xcode project file just has a <scripted> placeholder string for the build number.)
# Pulls the major version FROM the Plist File (set in Xcode)
# Puts the generated build number INTO the Plist File (overwriting whatever was set in Xcode)
@kitschpatrol
kitschpatrol / deploy-to-testflight.sh
Created May 9, 2014 14:36
Deploy to Testflight
#!/bin/bash
echo "Building and Deploying App to TestFlight"
# Move up a level to build directory
cd ..
# Check for Nomad: http://nomad-cli.com
if ! command -v ipa 2>/dev/null; then
echo "Nomad is required! Please run \"gem install nomad-cli\""
#!/bin/bash
# Automatically tags the git repo's current head with
# the latest build number from the build number scratch file
PLIST_FILE="../SciGames Sandbox/SciGames Sandbox-Info.plist"
BUILD_NUMBER=`cat ../BuildNumber`
echo Tagging current head with \"$BUILD_NUMBER\"
`git tag $BUILD_NUMBER`