Skip to content

Instantly share code, notes, and snippets.

@LeonardoCardoso
LeonardoCardoso / Reflection.swift
Created May 21, 2016 18:13
Get any class properties using reflection
// MARK: - Get properties using reflection
extension NSObject {
func properties() -> [String: String]{
var results: [String: String] = [:]
for child in Mirror(reflecting: self).children {
var propertyName = ""
@LeonardoCardoso
LeonardoCardoso / gitzip.sh
Last active December 22, 2024 21:31
Zip folder ignoring files listed on .gitignore
#...
function gitzip() {
git archive -o [email protected] HEAD
}
#... gitzip ZIPPED_FILE_NAME
class func executeAfter(delay: TimeInterval, block: @escaping () -> Void){
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + delay, execute: block)
}
import Foundation
extension String {
var parseJSON: AnyObject? {
let data = self.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: false)
if let jsonData = data {
@LeonardoCardoso
LeonardoCardoso / ScrollTextView.java
Last active January 21, 2022 07:37
TextView with continuous scroll marquee animation no matter where the Activity focus is.
public class ScrollTextView extends TextView {
public ScrollTextView(Context context) {
super(context);
}
public ScrollTextView(Context context, AttributeSet attrs) {
super(context, attrs);
}
@LeonardoCardoso
LeonardoCardoso / cpwd.sh
Last active October 30, 2018 09:59
One line command to copy the current terminal path on Mac
#...
alias cpwd="pwd | tr -d '\n' | pbcopy"
#...
@LeonardoCardoso
LeonardoCardoso / Podfile-Snippet
Last active October 30, 2018 09:59
Podfile Snippet: 'Build Active Architecture Only' to 'NO' and 'Valid Architectures' to '$(ARCHS_STANDARD)' to all pods
# insert this at the end of your Podfile
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ARCHS'] = '$(ARCHS_STANDARD)' # it sets 'Valid Architectures' to '$(ARCHS_STANDARD)' to all pods
target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO' # it sets 'Build Active Architecture Only' to 'NO'
end
end
end
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 20, 2025 21:15
The best FRP iOS resources.

Videos

@funroll
funroll / Podfile-snippet
Created June 22, 2014 04:23
CocoaPods post_install step for changing Build Active Architecture Only from Yes to No.
post_install do |installer|
installer.project.targets.each do |target|
target.build_configurations.each do |configuration|
target.build_settings(configuration.name)['ONLY_ACTIVE_ARCH'] = 'NO'
end
end
end