Skip to content

Instantly share code, notes, and snippets.

@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
@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 / .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 / 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 / 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 / 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 / symlink-to-ios-simulator-documents-directory.m
Created December 3, 2015 12:03
symlink to ios simulator documents directory
@mgamer
mgamer / gist:731061be3aec016583ae
Created April 18, 2015 16:00
Gmail - show trimmed content in current email
(function() {
var clickExpand = function() {
var btns = document.querySelectorAll(".ajR[aria-label='Show trimmed content']");
if (btns.length > 0) {
var btn = btns[btns.length - 1];
btn.click();
}
};
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 4.4.2 (https://www.mediafire.com/?qbbt4lhyu9q10ix)
Google Apps for Android 4.3 (http://goo.im/gapps/gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (http://goo.im/gapps/gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (http://goo.im/gapps/gapps-jb-20121011-signed.zip)
[
{
"guid": "0018e596284a49eaa3bc22c8ed88ac11",
"title": "NIUK - Nowy niskoprofilowy cooler Akasa Nero LX",
"description": "Akasa poszerza swoją ofertę systemów chłodzenia procesorów o nowy model o nazwie Nero LX. Cooler ma niskoprofilową budowę i tylko 59 milimetrów wysokości, dzięki czemu może być stosowany w zyskujących coraz większą popularność niewielkich komputerach stacjonarnych i HTPC. Producent wyposażył go w cztery miedziane ciepłowody połączone z radiatorem złożonym z gęsto ułożonych cienkich finów, których krawędzie zostały dodatkowo pofalowane w celu poprawy rozpraszania ciepła. Radiator owiewany jest przez wentylator o średnicy 120mm i wysokości 15mm, mogący obracać się z prędkością od 600 do 1900 RPM, emitując przy tym szum o natężeniu od 11,5 do 31,5 dBA.\r\n ",
"small_image": "http://pursuitist.com/wp-content/uploads/2011/07/New-BMW-1-Series.png",
"date": "2012-12-04T19:33:00Z",
"category": "world news