Skip to content

Instantly share code, notes, and snippets.

View issuran's full-sized avatar
👨‍🍳
Baking some code

Tiago Oliveira issuran

👨‍🍳
Baking some code
View GitHub Profile
@issuran
issuran / uibutton_rotate_swift_ios.txt
Last active August 29, 2018 17:19
Turn UIButton Upside down - Turn 180º and back again - Swift 4
// Turn UIButton 180º
UIButton.transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi))
// Turn UIButton 0º or back again
UIButton.transform = CGAffineTransform(rotationAngle: 0)
@issuran
issuran / Record iOS emulator video
Last active March 21, 2021 11:39
How to capture iOS Simulator video
1- First of all, you have to run your app on the simulator.
2- Then, open the terminal
3- Now, you have to run the command you desire:
- Screenshot: xcrun simctl io booted screenshot
- Video: xcrun simctl io booted recordVideo <filename>.<file extension>.
For example: xcrun simctl io booted recordVideo appvideo.mov
4- Press cntrl + c to stop recording the video.
@issuran
issuran / Delete untracked files
Created July 12, 2018 13:23
When there is nothing to commit but still have facing issues with untracked files
git 2.11 and newer
git clean -d -fx .
older git
git clean -d -fx ""
-x means ignored files are also removed as well as files unknown to git.
-d means remove untracked directories in addition to untracked files.
-f is required to force it to run.
@issuran
issuran / Using kdiff3
Created July 12, 2018 13:34
Changing mergetool tool to use kdiff3 on Mac
The list of supported tools
$ git mergetool --tool-help
Setting kdiff3 as mergetool tool
$ git config --global merge.tool kdiff3
In case you want to config diff.tool
$ git config --global diff.tool kdiff3
If kdiff3 is not in your PATH environment also do
@issuran
issuran / DecodeAnything.swift
Last active October 11, 2023 14:26
Decoding anything
import UIKit
struct MyModel: Decodable {
let name: String
}
struct MyOtherModel: Decodable {
let otherName: String
}
@issuran
issuran / ValidateModel.swift
Last active October 17, 2023 18:49
Playground to validate model/response faster
import UIKit
// TEST MODEL HERE
struct TestModel: Codable {
let name: String
let ages: [String]
enum CodingKeys: String, CodingKey {
case name = "nome"
case ages = "idades"
}