Skip to content

Instantly share code, notes, and snippets.

View fjcaetano's full-sized avatar
⌨️

Flávio Caetano fjcaetano

⌨️
View GitHub Profile
@fjcaetano
fjcaetano / export-ipa.sh
Created November 18, 2021 20:33
Manually export an iOS enterprise build
#! /bin/sh
ARCHIVE_PATH="$1"
OUTPUT_PATH="$2"
if [ -z "${ARCHIVE_PATH}" ] || [ -z "${OUTPUT_PATH}" ]; then
echo "Usage: $0 [archive_path] [output_path]"
exit 1
fi
TMP_PATH="/tmp/manual-archive"

Keybase proof

I hereby claim:

  • I am fjcaetano on github.
  • I am fjcaetano (https://keybase.io/fjcaetano) on keybase.
  • I have a public key ASBPByTOBjczHP-AUH3vIlMW7Lq2bslvhRAJTTU63iW6ego

To claim this, I am signing this object:

@fjcaetano
fjcaetano / withPure.tsx
Created December 11, 2018 17:47
Pure React component HOC in Typescript
import React from 'react';
const withPure = <P extends any>(
WrappedComponent: React.ComponentType<P>,
): React.ComponentClass<P> => {
class Purified extends React.PureComponent<P> {
render() {
return <WrappedComponent {...this.props} />;
}
}
@fjcaetano
fjcaetano / DispatchQueue+DebounceThrottle.swift
Last active September 23, 2021 07:25
Debounce + Throttle
import Dispatch
private var throttleWorkItems = [AnyHashable: DispatchWorkItem]()
private var lastDebounceCallTimes = [AnyHashable: DispatchTime]()
private let nilContext: AnyHashable = arc4random()
public extension DispatchQueue {
/**
- parameters:
- deadline: The timespan to delay a closure execution
@fjcaetano
fjcaetano / ios_simulator.rb
Created November 13, 2017 16:09
iOS Simulator launcher Fastlane action
module Fastlane
module Actions
module SharedValues
IOS_SIMULATOR_CUSTOM_VALUE = :IOS_SIMULATOR_CUSTOM_VALUE
end
class IosSimulatorAction < Action
@@already_booted_code = 164
def self.run(params)
@fjcaetano
fjcaetano / codecov.rb
Last active February 8, 2021 19:59
Codecov Fastlane action
module Fastlane
module Actions
class CodecovAction < Action
def self.run(params)
ci_only = params[:ci_only]
cmd = ['curl -s https://codecov.io/bash | bash']
cmd << "-s --" if params.all_keys.inject(false) { |p, k| p or params[k] }
cmd << "-X xcodeplist" if params[:use_xcodeplist]
cmd << "-J '#{params[:project_name]}'" if params[:project_name]
@fjcaetano
fjcaetano / ChallengeViewController.swift
Created September 27, 2016 21:57
RxSwift error example
//
// ChallengeViewController.swift
// WinninApp
//
// Created by Flávio Caetano on 9/26/16.
// Copyright © 2016 Winnin. All rights reserved.
//
import UIKit
import RxSwift
@fjcaetano
fjcaetano / changelog.sh
Last active March 3, 2016 16:05
Changelog from previous tag
echo "Printing Changelog"
git log $(git describe --abbrev=0)..HEAD --pretty=oneline --abbrev-commit | envman add --key GIT_CHANGELOG
echo $GIT_CHANGELOG
@fjcaetano
fjcaetano / version_bumper.sh
Created September 3, 2015 22:33
Xcode Version Bumper
bN=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
bN=$(($bN + 1))
bN=$(printf "%d" $bN)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bN" "${PROJECT_DIR}/${INFOPLIST_FILE}"
@fjcaetano
fjcaetano / build.sh
Created September 3, 2015 21:39
Universal Framework Build Script
#!/bin/sh
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else