Skip to content

Instantly share code, notes, and snippets.

View sarah-j-smith's full-sized avatar

Sarah Smith sarah-j-smith

View GitHub Profile
@sarah-j-smith
sarah-j-smith / DemoLookProblem.aslx
Created November 4, 2015 11:45
DemoLookProblem
<!--Saved by Quest 5.6.5621.18142-->
<asl version="550">
<include ref="English.aslx" />
<include ref="Core.aslx" />
<game name="DemoLookProblem">
<gameid>dd090fb4-755b-4ed8-8a78-debf97652988</gameid>
<version>1.0</version>
<firstpublished>2015</firstpublished>
<appendobjectdescription />
</game>
@sarah-j-smith
sarah-j-smith / scaleToWidth
Last active November 9, 2016 02:07
Create SD, Retina and @3x Images of a given size.
#!/bin/sh
filename=$(basename "$1")
extension="${filename##*.}"
filename="${filename%.*}"
if [ -z $1 ]; then
echo "Usage: $0 image.png <points wide>"
echo " produces 3 copies of the image, in SD, @2x and @3x for that point size"
exit;
@sarah-j-smith
sarah-j-smith / icons.sh
Created November 7, 2016 10:53
Produce a set of icons for an iOS app from a PNG image.
#!/bin/sh
SIZES="58 87 80 120 180 29 20 40 60 76 158 152 167"
OUTBASENAME=$(basename "$1" .png)
for sz in $SIZES; do
newImage="${OUTBASENAME}-${sz}x${sz}.png"
cp "$1" "$newImage"
sips --resampleHeightWidth $sz $sz "$newImage"
@sarah-j-smith
sarah-j-smith / .bash_profile
Last active July 2, 2021 02:17
Simple .bashrc that creates a blue prompt line with the current path. The .bash_profile also turns on colorisation for `ls` (list files) output; and has some examples for other improvements.
source ~/.bashrc
# Have an ls that is in color by default
alias ls='ls -G '
# Use the tree command - need to install it first from here
# http://andre-als.blogspot.com.au/2012/02/how-to-install-command-tree-for-mac.html
alias tree='tree -C '
# Create a nice short cut for git logs
@sarah-j-smith
sarah-j-smith / simple-vimrc
Last active August 6, 2023 11:42
Simple .vimrc for Mac OSX
" Use spaces instead of tabs
set expandtab
" Be smart when using tabkey
set smarttab
" 1 tab == 4 spaces
set shiftwidth=4
set tabstop=4
class Request {
// DTO that can be accessed from different threads
// Note: this is faster/better/approved by Apple instead of @synchronized and
// other constructs (even tho' its a bit more verbose). DispatchQueue by
// default is Serial so this synchronizes accesses.
private var requestStateQueue = DispatchQueue(label: "requestStateQueue")
private var _cancelled = false
/** Set to true to cancel this request - atomic/threadsafe */
var cancelled: Bool {
@sarah-j-smith
sarah-j-smith / AppDelegate.swift
Last active October 20, 2017 07:16
AWS Mobile Hub + DynamoDB Low-Level API
//
// AppDelegate.swift
//
import UIKit
import AWSPinpoint
import AWSAuthCore
import AWSUserPoolsSignIn
import CocoaLumberjackSwift
@sarah-j-smith
sarah-j-smith / Python3 Virtualenv Setup.md
Last active November 13, 2019 03:43 — forked from pandafulmanda/Python3 Virtualenv Setup.md
TensorFlow/Python3/Jupyter Virtualenv on Mac
@sarah-j-smith
sarah-j-smith / fixed-pip.sh
Created June 13, 2018 01:36
Fix for pip incompatibilities
# This Ubuntu issue seems to be affecting Python/pip on Mac - https://github.com/beenje/script.module.requests/issues/21
# requests 2.18.2 has requirement urllib3<1.23,>=1.21.1, but you'll have urllib3 1.23 which is incompatible.
# Force the version of urllib3
pip install urllib3==1.22
@sarah-j-smith
sarah-j-smith / Tar pipe
Created September 14, 2019 04:59
The amazingly awesome tar pipe command for copying trees of files around
# https://blog.extracheese.org/2010/05/the-tar-pipe.html
# on Mac the --exclude-vcs is not available - can add --exclude .git
(cd /Users/ssmith6/depot/js-intro-workshop && tar cf - .)|(cd /Users/ssmith6/depot/Android101 && tar xvfp -)