Skip to content

Instantly share code, notes, and snippets.

View ManWithBear's full-sized avatar
🐻
Bear with it

Denis Bogomolov ManWithBear

🐻
Bear with it
View GitHub Profile
@ManWithBear
ManWithBear / delete_all_simulators.sh
Created September 19, 2018 08:18
Script to delete all your simulators
#!/bin/bash
xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}' | xargs)
xcrun simctl delete unavailable
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation

FrontRow Style Guide

Principles:

  • Maximize readability
    • Code should be immediately readable by someone not familiar with that area. If you have to continuously refer to documentation, comments or dig into implementation to understand what's happening, the code isn't sufficiently self-descriptive and needs to be improved. When not possible, you must comment. Coding is a team sport, always write with other developers in mind
  • Be aware of the context
  • Use your judgement

There are some hard rules, but good style is context-sensitive.

@ManWithBear
ManWithBear / multi_devices_test.sh
Created April 20, 2018 15:01 — forked from fedejordan/multi_devices_test.sh
Blog01 - Script for run tests in different devices for an iOS project
#!/bin/bash
# Script configuration
devicesArray=(
"iPhone 8"
"iPhone 8 Plus"
"iPhone 5s"
"iPhone X")
infix operator ⎽⟋: AdditionPrecedence
func ⎽⟋(_ left: Any, _ right: Any) { }
infix operator ⟍⎽: AdditionPrecedence
func ⟍⎽(_ left: Any, _ right: Any) { }
let ¯ = ""
let ツ = ""
let dunno = ¯⟍⎽(ツ)⎽⟋¯
syntax on " syntax highlightnig
set number " add line number
set mouse=a " enable mouse
set ruler " cursor position in bottom right corner
set tabstop=4 " number of spaces per tab
set autoindent " start new line on same indentation
set expandtab " use spaces instead of tabs
filetype on " try to understand type of file for highlighting
@ManWithBear
ManWithBear / .bash_profile
Last active November 29, 2019 23:14
My work bash_profile
source ~/.profile
source ~/.git-completion.bash
source ~/.git-prompt.sh
source ~/tools/arcanist/resources/shell/bash-completion
export PATH="$PATH:$HOME/tools/arcanist/bin/"
export EDITOR="/usr/bin/vim"
PS1='\[\e[31m\][\[\e[0m\]\W$(__git_ps1 " (\[\e[36m\]%s\[\e[0m\])")\[\e[31m\]]\[\e[0m\]\$ '
alias be='bundle exec'
alias ll='ls -al'
@ManWithBear
ManWithBear / Build_timing.md
Created August 2, 2017 08:36
Show duration of last action in toolbar
@ManWithBear
ManWithBear / xcode.md
Last active September 25, 2018 08:35
Move open bracket on new line in default xcode snippets
  1. Find SystemCodeSnippets.codesnippets file. For Xcode8:
    /Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/SystemCodeSnippets.codesnippets
  2. Make save copy of snippets cp SystemCodeSnippets.codesnippets ~/Desktop/
  3. Open in vim: sudo vim SystemCodeSnippets.codesnippets
  4. Move every open bracket on new line :%s/ {/\r{/g
  5. Save and close :wq
  6. Restart Xcode
  7. ????
  8. PROFIT!
@ManWithBear
ManWithBear / VersionBump.sh
Created May 29, 2017 13:16
Build version bump in yyyymmddxx format
releaseName=`date '+%Y%m%d'`
oldRelease=`cat {project name}/SupportFiles/Info.plist | sed -n '/CFBundleVersion/{n;p;}' | cut -d '>' -f2 | cut -d '<' -f1`
oldTemp=${oldRelease:0:8}
if [ $oldTemp == $releaseName ]
then
suffix=${oldRelease:8}
suffix=$(($suffix + 1))
printf -v suffix "%02d" $suffix
else
suffix=01