Skip to content

Instantly share code, notes, and snippets.

@mgamer
mgamer / appcode.vmoptions
Created December 13, 2015 10:08 — forked from garriguv/appcode.vmoptions
AppCode JVM options
-Xss2m
-Xms512m
-Xmx4096m
-XX:NewSize=128m
-XX:MaxNewSize=128m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=96m
-XX:+UseCompressedOops
@mgamer
mgamer / pre-commit
Last active January 9, 2017 10:35 — forked from DerLobi/pre-commit
Don't commit focused tests. Use this as a pre-commit hook and all staged changes that contain `fdescribe`, `fcontext`, `fit`, `fspecify` or `fexample` will be replaced with `describe`, `context`, `it` or `example`. Copy this file as `pre-commit` into the `.git/hooks` folder of your repository (create it if neccessary) and chmod +x the file.
#!/bin/sh
#adapted from https://gist.github.com/mgamer/132534fe1155fb40adc5adfc58790373
DESCRIBEFILES=$(git diff --staged -G"^\s*fdescribe\(" --name-only | wc -l)
if [ $DESCRIBEFILES -gt 0 ]
then
echo "You forgot to remove a fdescribe in the following files:"
git --no-pager diff --staged --name-only -G"^\s*fdescribe\(" | xargs -L1 -I {} sh -c 'sed -i "" "s/\s*fdescribe(/describe(/g" {}; git add "{}"'
echo "This is fixed automatically now"
@mgamer
mgamer / gist:4a148186b988abc37ec93cb2b4a0602a
Created June 16, 2017 13:05
watch swift files for changes and inject to running simulator
filewatcher '**/*.swift' '/Applications/Injection.app/Contents/Resources/injectSource `pwd`/$FILENAME'
@mgamer
mgamer / .squash.sh
Created September 9, 2017 15:59
git squash
#!/bin/sh
# based on https://stackoverflow.com/a/24018435/59666
#base commit of the squash-"rebase
baseCommit=$1
#get the commit message
shift
commitMsg=$@
@mgamer
mgamer / .gitconfig
Created September 9, 2017 15:59
.gitconfig
[alias]
co = checkout
ec = config --global -e
up = !git pull --rebase --prune $@ && git submodule update --init --recursive
cob = checkout -b
cm = !git add -A && git commit -m
save = !git add -A && git commit -m 'fixup! SAVEPOINT'
wip = !git add -u && git commit -m "WIP"
undo = reset HEAD~1 --mixed
amend = commit -a --amend
@mgamer
mgamer / fix bose
Created February 6, 2018 13:51
fix bose
while :
do
SOURCE=`SwitchAudioSource -t input -c`
if [ "$SOURCE" = 'mbose' ]
then
echo "mbose is on, disabling it"
SwitchAudioSource -t input -s "Built-in Microphone"
fi
sleep 1
done