Skip to content

Instantly share code, notes, and snippets.

@polok
polok / .zshrc
Last active January 3, 2023 21:19
iterm2 + oh-my-zsh
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
ZSH_THEME="eastwood"
# Uncomment the following line to disable colors in ls.
DISABLE_LS_COLORS="true"
plugins=(
git
@polok
polok / xcodebuild build-for-testing
Created February 9, 2022 10:47
[TERMINAL] xcodebuild build-for-testing
xcodebuild \
build-for-testing \
-workspace XXX.xcworkspace \
-scheme XXX_SCHEME \
-destination 'platform=iOS Simulator,name=iPhone 11' \
-derivedDataPath ./build/iOS/
@polok
polok / bash
Created July 22, 2019 06:33
[Git] Empty commit
$ git commit --allow-empty -m "Empty message"
@polok
polok / brew_switch_swiftformat
Last active July 15, 2019 07:38
Swiftformat version switch using brew
brew switch swiftformat XXX
Before above check that you have requested swiftformat version. In my case it was here:
/usr/local/Cellar/swiftformat
Example:
brew switch swiftformat 0.37.5
@polok
polok / file.swift
Created January 12, 2017 06:41
Small function to rotate the image clockwise or counterclockwise
func rotate(image: UIImage, clockwise: Bool) -> UIImage {
var rotatedImage: UIImage?
let rotateSize = CGSize(width: image.size.height, height: image.size.width)
UIGraphicsBeginImageContextWithOptions(rotateSize, false, 1.0)
guard let context = UIGraphicsGetCurrentContext() else {
return image
}
@polok
polok / shadow.xml
Last active November 15, 2016 09:34
[Android] Elevation on Pre-lollipop Devices
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<gradient
android:startColor="@android:color/transparent"
android:endColor="#44000000"
android:angle="90"/>
</shape>