Skip to content

Instantly share code, notes, and snippets.

View SergioEstevao's full-sized avatar

Sérgio Estêvão SergioEstevao

View GitHub Profile
@SergioEstevao
SergioEstevao / .clang-format
Created March 18, 2015 10:26
clang-format configuration for WordPress coding guidelines for iOS
---
Language: Cpp
# BasedOnStyle: WebKit
AccessModifierOffset: -4
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
@SergioEstevao
SergioEstevao / gist:67be064cc9554437a53a
Created January 21, 2015 23:47
Sending message to github
sha=`echo $TRAVIS_COMMIT_RANGE | cut -d '.' -f 4`
full_sha=`git rev-parse $sha`
travis_url="https://travis-ci.org/${TRAVIS_REPO_SLUG}/builds/${TRAVIS_BUILD_ID}/"
if [[ $errors -eq 0 ]]; then
state="success"
message="OCLinted OK!"
else
state="failure"
message="OCLint detected new issues!"
fi
@SergioEstevao
SergioEstevao / gist:10006980
Last active August 29, 2015 13:58
Build IPA with xcodebuild
# First build the archive
xcodebuild archive -scheme $SCHEME_NAME -archivePath $ARCHIVE_NAME
# Then export it to an IPA
xcodebuild -exportArchive -archivePath $ARCHIVE_NAME.xcarchive -exportPath $ARCHIVE_NAME -exportFormat ipa -exportProvisioningProfile "$PROVISIONING_PROFILE" -exportSigningIdentity "$DEVELOPER_NAME"
@SergioEstevao
SergioEstevao / gist:10006842
Created April 6, 2014 14:31
PackageApplication example
xcrun -log -sdk iphoneos PackageApplication "$OUTPUTDIR/$APPNAME.app" -o "$OUTPUTDIR/$APPNAME.ipa" -sign "$DEVELOPER_NAME" -embed "$PROVISIONING_PROFILE"
@SergioEstevao
SergioEstevao / 0_reuse_code.js
Created February 6, 2014 13:42
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@SergioEstevao
SergioEstevao / OCLint Jenkins
Created November 21, 2013 22:44
A script for running OCLint in Jenkins and create PMD reports
#import path
export PATH=${PATH}:/usr/local/bin
#import what we have in bash_profile
source ~/.bash_profile
#check for oclint
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
@SergioEstevao
SergioEstevao / OCLint Xcode
Created November 21, 2013 22:39
An OCLint script to use on Xcode
#import path
export PATH=${PATH}:/usr/local/bin
#import what we have in bash_profile
source ~/.bash_profile
#check for oclint
hash oclint &> /dev/null
if [ $? -eq 1 ]; then
echo >&2 "oclint not found, analyzing stopped"
exit 1
fi
@SergioEstevao
SergioEstevao / ObjC sharedInstance template
Last active December 20, 2015 15:39
iOS generic sharedInstance implementation
+ (instancetype) sharedInstance {
static id _sharedInstance = nil;
static dispatch_once_t _onceToken;
dispatch_once(&_onceToken, ^{
_sharedInstance = [[self alloc] init];
});
return _sharedInstance;
}
@SergioEstevao
SergioEstevao / Apple Doc documentation script
Last active December 18, 2015 21:09
AppleDoc documentation generation script
appledoc \
--project-name ${PROJECT} \
--project-company "Sergio Estevao" \
--company-id com.sergioestevao \
--docset-atom-filename "${PROJECT}.atom" \
--docset-feed-url "http://localhost/help/${PROJECT}/%DOCSETATOMFILENAME" \
--docset-package-url "http://localhost/help/${PROJECT}/%DOCSETPACKAGEFILENAME" \
--docset-fallback-url "http://localhost/help/${PROJECT}/" \
--publish-docset \
--logformat xcode \
@SergioEstevao
SergioEstevao / gist:5845431
Created June 23, 2013 15:34
MOGenerator automatic generation script when updating database files.
mogenerator --model "${INPUT_FILE_PATH}" \
--output-dir "${PROJECT_DIR}/XXXXX/Source/Model" \
--template-var arc=true
${DEVELOPER_BIN_DIR}/momc \
-XD_MOMC_TARGET_VERSION=10.7 \
"${INPUT_FILE_PATH}" "${TARGET_BUILD_DIR}/${EXECUTABLE_FOLDER_PATH}/${INPUT_FILE_BASE}.mom"