Skip to content

Instantly share code, notes, and snippets.

View vilanovi's full-sized avatar

Joan Martin vilanovi

View GitHub Profile
@vilanovi
vilanovi / system-install
Last active May 27, 2022 15:03
System Bootsrap installation for apps
#!/bin/bash
## GEMS
# Coding
sudo gem install cocoapods
sudo gem install fastlane
## Homebrew
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@vilanovi
vilanovi / pod-install
Created October 25, 2021 22:47
Runs pod install on the same version of the Podfile.lock, installing cocoapods version via gem if not installed.
#!/bin/bash
bold=$(tput bold)
normal=$(tput sgr0)
if test -f "Podfile.lock";
then
VALUE=`cat Podfile.lock | grep COCOAPODS`
POD_VER=$(echo $VALUE | sed 's/COCOAPODS: //g')
@vilanovi
vilanovi / git-mirror.sh
Created June 11, 2021 11:35
Mirrors an existing repository into a new repository
# USAGE: ./git-mirror git@domain.com:account/source.git git@domain.com:account/destination.git
echo "";
echo "Cloning repository source: $1";
echo "";
git clone --mirror $1 temp-folder
echo "";
echo "Adding new origin: $2";
##############################################################################################################
# This script is only to be run once to generate NamespacedDependencies.h, do not run multiple times
# Uncomment the following line to prevent the script running
# exit 0
# This script is a modified version of this: https://github.com/jverkoey/nimbus/blob/master/scripts/generate_namespace_header
##############################################################################################################
######################################################
# Link here to the file where the namespaced dependencies will be listed
header=$PROJECT_DIR/NamespacedDependencies.h
@vilanovi
vilanovi / Find First Responder (fast)
Created May 26, 2014 15:11
Find First Responder by asking UIApplication
// ************************************************************* //
// UIResponder+FirstResponder.h
// ************************************************************* //
@interface UIResponder (FirstResponder)
+ (UIResponder*)firstResponder;
@end
@vilanovi
vilanovi / Find First Responder Swizzeling
Last active August 29, 2015 14:01
Find the first responder by swizzeling methods of UIResponder
// ************************************************************ //
// UIResponder+FirstResponder.h
// ************************************************************ //
@interface UIResponder (FirstResponder)
+ (UIResponder*)firstResponder;
@end
@vilanovi
vilanovi / Find First Responder Recursively
Last active August 29, 2015 14:01
Recursive way to find the first responder
// ************************************************************ //
// UIResponder+FirstResponder.h
// ************************************************************ //
@interface UIResponder (FirstResponder)
+ (UIResponder*)firstResponder;
@end
@vilanovi
vilanovi / Swizzle
Last active August 29, 2015 14:01
Objective-C selector swizzle
// ************************************************************ //
// NSObject + Swizzle.h
// ************************************************************ //
@interface NSObject (Swizzle)
+ (void)swizzleSelector:(SEL)selector withSelector:(SEL)newSelector;
@end