Skip to content

Instantly share code, notes, and snippets.

View rpassis's full-sized avatar

Rogerio de Paula Assis rpassis

  • ANZx
  • Sunshine Beach, Australia
View GitHub Profile
@rpassis
rpassis / gist:fb137f0f3b1d3984c880
Created September 15, 2014 04:53
Set build number automatically in Xcode
#
# Set the build number to the current git commit count.
# If we're using the Dev scheme, then we'll suffix the build
# number with the current branch name, to make collisions
# far less likely across feature branches.
# Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/
#
git=`sh /etc/profile; which git`
appBuild=`"$git" rev-list --all |wc -l`
if [ $CONFIGURATION = "Debug" ]; then
@rpassis
rpassis / gist:0a13809df6c084980a19
Last active August 29, 2015 14:09
Stop postgresql on a Cloud66 rails deployment
ps xa | grep postgres: | grep $POSTGRESQL_DATABASE | grep -v grep | awk '{print $1}' | sudo xargs kill
@rpassis
rpassis / gist:80ae3a86ef1d8510087e
Last active August 29, 2015 14:20
Cloud66 - Load environment as nginx
sudo -u nginx bash -c 'source /var/.cloud66_env && bundle exec rails c'
@rpassis
rpassis / FRP iOS Learning resources.md
Created February 4, 2016 03:31 — forked from JaviLorbada/FRP iOS Learning resources.md
The best FRP iOS resources.

Videos

@rpassis
rpassis / pre_build_trigger.sh
Last active May 2, 2016 06:11
Xcode bot before trigger with cocoapods
export LC_ALL="en_US.UTF-8"
PODFILE=`find . -type f -name Podfile`
cd `dirname $PODFILE`
POD_PATH=`which pod`
$POD_PATH install
@rpassis
rpassis / gist:ea8f44ad07a5c7ae5108c97d2560a990
Created May 23, 2016 00:20
Docker App fails to connect to localhost when pow is installed
Pow install script enables the PF firewall and adds a rule to forward all port 80 traffic to the Pow server port.
Unfortunately, simply stopping the Pow server won't help as it doesn't stop PF.
Stop PF and use Docker for Mac: `sudo pfctl -d`
Start PF and use Pow: `sudo pfctl -e`
@rpassis
rpassis / universal-framework.sh
Created September 20, 2016 12:24 — forked from cromandini/universal-framework.sh
This run script will build the iphoneos and iphonesimulator schemes and then combine them into a single framework using the lipo tool (including all the Swift module architectures).
#!/bin/sh
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
# make sure the output directory exists
mkdir -p "${UNIVERSAL_OUTPUTFOLDER}"
# Step 1. Build Device and Simulator versions
xcodebuild -target "${PROJECT_NAME}" ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
xcodebuild -target "${PROJECT_NAME}" -configuration ${CONFIGURATION} -sdk iphonesimulator ONLY_ACTIVE_ARCH=NO BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}" clean build
@rpassis
rpassis / KeyboardObservable.swift
Last active November 3, 2016 22:23
Protocol for observing keyboardWillShow & keyboardWillHide notifications
import UIKit
protocol KeyboardObservable {
var bottomSpaceToMainViewConstraint: NSLayoutConstraint! { get }
func subscribeToKeyboardNotifications()
}
extension KeyboardObservable where Self: UIViewController {
@rpassis
rpassis / ImagePickerHandler.swift
Last active August 27, 2019 10:40
Protocol and extension for handling the presentation of image picker controllers and selection of media
// Since we are unable to extend ObjC protocols in swift, we wrap this around a custom NSObject subclass
// that deals exclusive with handling the image picker delegate methods and chaining the response down to
// the MediaPickerPresenter conforming delegate
class ImagePickerHandler: NSObject, UIImagePickerControllerDelegate, UINavigationControllerDelegate {
var delegate: MediaPickerPresenter?
let sourceType: UIImagePickerControllerSourceType
let picker = UIImagePickerController()

Keybase proof

I hereby claim:

  • I am rpassis on github.
  • I am rogerio (https://keybase.io/rogerio) on keybase.
  • I have a public key whose fingerprint is 93B9 0AFB 0F54 4E95 B636 D6DB 5D85 65EB 0F79 CE6A

To claim this, I am signing this object: