Skip to content

Instantly share code, notes, and snippets.

@Gerst20051
Gerst20051 / clean_xcode.sh
Created June 25, 2016 05:06 — forked from Jerrot/clean_xcode.sh
Resets all installed Xcode simulators and deletes the contents of Derived Data
#!/bin/sh
instruments -s devices \
| grep "(\d[.0-9]\+) \[[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}\]" \
| grep -o "[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}" \
| while read -r line ; do
echo "Reseting Simulator with UDID: $line"
xcrun simctl erase $line
done
@Gerst20051
Gerst20051 / All Roms Full List Stats.txt
Last active December 7, 2017 23:06
Retro Game Roms List
[$]> find . ! -name . ! -name .DS_Store | cut -c 3- | rev | cut -f2- -d'.' | rev > ~/Dropbox/Misc/Other/All\ Roms\ Full\ List.txt
[$]> paste -d':' <( du -h -- "." | \grep -v 'Automatically Import\|unsorted' | cut -f1 ) <(( \ls -fo -- "." | \grep -v 'total\|\.\|Automatically Import\|unsorted' | awk '{ print $2 }' & \ls -fo -- "." | \grep -v 'total\|\.\|Automatically Import\|unsorted' | awk '{ print $2 }' | paste -sd+ - | bc )) <( \ls -f -- "." | \grep -v 'total\|\.\|Automatically Import\|unsorted' ) | column -t -s':'
Stats
11M 1763 Atari 2600
1.3M 81 Atari 5200
14M 185 Atari 7800
43M 302 Atari Lynx
@Gerst20051
Gerst20051 / DeviceInfo.swift
Last active January 7, 2017 17:49
Swift Device Info - Pixels Per Inch
import Foundation
import UIKit
class DeviceInfo {
class func getRawSystemInfoString() -> String {
var systemInfo = utsname()
uname(&systemInfo)
return withUnsafeMutablePointer(&systemInfo.machine) { ptr in String.fromCString(UnsafePointer<CChar>(ptr))! }
}
@Gerst20051
Gerst20051 / advancedsettings.xml
Created November 21, 2016 05:39
Kodi Advanced Settings
<!-- /storage/.kodi/userdata/advancedsettings.xml -->
<!-- http://androidpcreview.com/fix-kodi-buffering-problems-heres-how-to-modify-the-kodi-cache/2611/ -->
<advancedsettings>
<network>
<buffermode>1</buffermode>
<cachemembuffersize>104857600</cachemembuffersize>
<readbufferfactor>1.5</readbufferfactor>
</network>
</advancedsettings>
@Gerst20051
Gerst20051 / ~,.gradle,gradle.properties
Created November 21, 2016 17:38
Gradle Properties (Global)
org.gradle.daemon=true
org.gradle.jvmargs=-Xmx5120M
org.gradle.parallel=true
@Gerst20051
Gerst20051 / package_ipa.sh
Created November 22, 2016 19:24
Package IPA Bash Script
#!/bin/bash
DIR="$1"
APPNAME="$2"
APP="$DIR/$APPNAME.ipa"
FRAMEWORKS_DIR="$DIR/Payload/$APPNAME.app/Frameworks"
PACKAGED_IPA="$DIR/Packaged$APPNAME.ipa"
TEMP_IPA_BUILT='/tmp/ipabuild'
DEVELOPER_DIR=`xcode-select --print-path`
@Gerst20051
Gerst20051 / manual_archive.sh
Last active November 22, 2016 19:33
Manual Archive IPA Bash Script
#!/bin/bash
echo ''
################################# PROMPT #################################
itunesconnect_user='[email protected]'
printf "itunesconnect password for email '$itunesconnect_user': "
read -s itunesconnect_pass
##########################################################################
@Gerst20051
Gerst20051 / build_and_archive.sh
Created November 22, 2016 19:32
Build And Archive IPA Bash Script
#!/bin/bash
echo ''
################################# PROMPT #################################
itunesconnect_user='[email protected]'
printf "itunesconnect password for email '$itunesconnect_user': "
read -s itunesconnect_pass
##########################################################################
@Gerst20051
Gerst20051 / launch_app_simulator.sh
Last active October 11, 2019 06:15
Automator Script To Launch App In iOS Simulator
export PATH=/usr/local/bin:$PATH
which -s brew
if [[ $? != 0 ]]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
which ios-sim || brew install ios-sim
@Gerst20051
Gerst20051 / copy_latest_simulator_app_to_desktop.sh
Created November 23, 2016 18:11
Copy Latest Simulator App To Desktop Bash Script
#!/bin/bash
DESTINATION_DIR="$HOME/Desktop"
APP_PATH=$(find ~/Library/Developer/CoreSimulator/Devices/*/data/Containers/Bundle/Application/*/*.app -type d -maxdepth 0 -print0 | xargs -0 ls -td | head -n1)
APP_DIRNAME=$(dirname "$APP_PATH")
APP_BASENAME=$(basename "$APP_PATH")
FILE_EXTENSION="${APP_BASENAME##*.}"
FILE_NAME="${APP_BASENAME%.*}"
cd "$APP_DIRNAME"