Skip to content

Instantly share code, notes, and snippets.

View olgusirman's full-sized avatar

olgusirman olgusirman

View GitHub Profile
@olgusirman
olgusirman / showMeTheLines.sh
Last active January 21, 2022 09:35
Show me the class lines in my project
find -E . -regex '^\./[^(\.build|Pods)].+\.swift$' | tr \\n \\0 | xargs -0 wc -l | sort -r
@olgusirman
olgusirman / ConfigureRotateCameraImageToProperOrientation.swift
Created May 30, 2021 22:13
Sample helper code which decides UIImage orientation
extension UIImage {
func rotateCameraImageToProperOrientation(maxResolution: CGFloat) -> UIImage {
let imgRef: CGImage = cgImage!
let width: CGFloat = CGFloat(imgRef.width)
let height: CGFloat = CGFloat(imgRef.height)
var bounds: CGRect = CGRect(x: 0, y: 0, width: width, height: height)
var scaleRatio: CGFloat = 1
if width > maxResolution || height > maxResolution {
@olgusirman
olgusirman / FadeScrollView.swift
Created March 5, 2021 10:29 — forked from luismachado/FadeScrollView.swift
Custom UIScrollView with fade effect
//
// FadeScrollView.swift
//
// Created by Luís Machado on 23/06/2017.
// Copyright © 2017 Luis Machado. All rights reserved.
//
import UIKit
class FadeScrollView: UIScrollView, UIScrollViewDelegate {
@olgusirman
olgusirman / lipoThinFrameworkForAppleSilicon.sh
Created March 3, 2021 21:39
Update framework architecture for Apple Silicon
lipo WebRTC.framework/WebRTC -thin arm64 -output WebRTC.framework/WebRTC
@olgusirman
olgusirman / lipo.txt
Created March 2, 2021 22:14
Lipo command descriptions
https://ss64.com/osx/lipo.html
lipo
Create or operate on a universal file: convert a universal binary to a single architecture file, or vice versa.
Syntax
lipo [input_file]... [-arch arch_type input_file]... [-arch_blank arch_type]...
{ -info | -detailed_info }
[-output output_file] Operation
@olgusirman
olgusirman / bump-version.sh
Created February 24, 2021 16:22
bumped build and version number and commit it
# Find the current marketing version
OLD_VERSION=$(agvtool what-marketing-version -terse1)
# Get the current marketing version values
##replace . with space so can split into an array
VERSION_BITS=(${OLD_VERSION//./ })
##get tag number parts for version and build numbers
VNUM1=${VERSION_BITS[0]}
VNUM2=${VERSION_BITS[1]}

What are the render phases?

- Render prepare

- Render execute

We would like to draw a shadow, depends on the z-dimension hierarchy, first It needs to render to elements before the shadow rendering. That means, It needs to wait fake elements for drawing the render, after that the elements draw itself. This is called Offscreen pass

@olgusirman
olgusirman / bump-version.sh
Created November 26, 2020 12:26
This script gets the version and build number and automatically updates, set tag and commit
# Find the current marketing version
OLD_VERSION=$(agvtool what-marketing-version -terse1)
# Get the current marketing version values
##replace . with space so can split into an array
VERSION_BITS=(${OLD_VERSION//./ })
##get tag number parts for version and build numbers
@olgusirman
olgusirman / aerobuild.sh
Created November 26, 2020 10:43 — forked from idoru/aerobuild.sh
bump version, build & archive, tag git version and publish iOS app builds to testflight
#!/bin/sh
#
# aerobuild.sh
#
# What does this do?
# ==================
# - Bumps build numbers in your project using agvtool
# - Builds your app and packages it for testing/ad-hoc distribution
# - Commits build number changes to git
@olgusirman
olgusirman / aerobuild.sh
Created November 26, 2020 10:42 — forked from timgshi/aerobuild.sh
bump version, build & archive, tag git version and publish iOS app builds to testflight
#!/bin/sh
#
# aerobuild.sh
#
# What does this do?
# ==================
# - Bumps build numbers in your project using agvtool
# - Builds your app and packages it for testing/ad-hoc distribution
# - Commits build number changes to git