Skip to content

Instantly share code, notes, and snippets.

View binho's full-sized avatar

Cleber Santos binho

View GitHub Profile
@binho
binho / index.html
Last active August 29, 2015 13:56
install app page
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!--
Instructions:
1. Get UDID of the client device via iTunes.
2. Send the device UDID to developer portal.
3. Generate a new build with the UDID of the client.
4. Archive to enterprise distribribution and save in your machine.
5. Change MyApp.plist in this file to your generate plist file, the
@binho
binho / automatic_build_number.m
Created February 21, 2014 21:46
automatic generate build number
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
@binho
binho / ReactiveCocoaExample.m
Last active August 29, 2015 14:00
RAC Examples
// Check form
RACSignal *formValidate = [RACSignal
combineLatest:@[self.textField.rac_textSignal]
reduce:^(NSString *email) {
NSRange at = [email rangeOfString:@"@"];
return @(at.location != NSNotFound);
}];
[[formValidate map:^id(NSNumber *isValid) {
return isValid;
@binho
binho / ti-download-files-with-activity.js
Last active August 29, 2015 14:02
Titanium SDK - Android - Show activity indicator android download files
if (Ti.Platform.osname == 'android') {
var filesToDownload = [
{url: "http://site.com/image1.jpg"},
{url: "http://site.com/image2.jpg"},
{url: "http://site.com/image3.jpg"}
];
var totalFiles = filesToDownload.length;
@binho
binho / magicalrecord_reset_coredata.m
Created April 2, 2015 19:48
MagicalRecord remove and reset CoreData
- (void)resetCoreData {
DDLogInfo(@"[RESET-COREDATA] Started.");
[MagicalRecord cleanUp];
NSURL *storeURL = [NSPersistentStore MR_urlForStoreName:kMobilStoreName];
NSURL *walURL = [[storeURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sqlite-wal"];
NSURL *shmURL = [[storeURL URLByDeletingPathExtension] URLByAppendingPathExtension:@"sqlite-shm"];
@binho
binho / mogenerator_current_version.sh
Created July 27, 2015 18:11
Mogenerator generate based on version
type mogenerator >/dev/null 2>&1 || {
echo >&2 "Warning: mogenerator not found. You will need it when changing core data model";
exit 0;
}
cd "${SOURCE_ROOT}/${PROJECT_NAME}"
PATH_TO_MODELD="Resources/Model/${PROJECT_NAME}.xcdatamodeld"
CURRENT_MODEL_VERSION=$(/usr/libexec/PlistBuddy -c "Print :_XCCurrentVersionName" "${PATH_TO_MODELD}/.xccurrentversion")
MODEL_PATH="${PATH_TO_MODELD}/${CURRENT_MODEL_VERSION}"
@binho
binho / xcode_targets_check.md
Last active May 23, 2017 10:19
Xcode Build Phase for checking targets

Note: This build phase script should be added in all targets!

TARGET_NAMES=( ShowMe ShowMeDev ShowMeEnterprise )
PREV_TOTAL=0

for TARGET_NAME in "${TARGET_NAMES[@]}"; do
    TOTAL=`XcodeProjectTargetCheck -xcproj ${SRCROOT}/ShowMe.xcodeproj -targets ${TARGET_NAME} | wc -l`
    echo 'Target Name: '${TARGET_NAME} '- Total Files: '${TOTAL}
@binho
binho / download-subtitles.py
Last active September 1, 2016 19:52
Download subtitles using subliminal lib (https://github.com/Diaoul/subliminal)
#!/usr/bin/python
# -*- coding: utf-8 -*-
from datetime import timedelta
from babelfish import Language
from subliminal import download_best_subtitles, region, save_subtitles, scan_videos
import sys
import os
"""
@binho
binho / localization-report.py
Last active September 22, 2016 12:47
Localization Report
#!/usr/bin/python
# -*- coding: utf-8 -*-
import fnmatch
import sys
import os
num_strings_base = 0
strings_on_base = []
#!/bin/bash
DIRECTORY=$1
echo "------------------------------"
echo "Passed Resources with xcassets folder argument is <$DIRECTORY>"
echo "------------------------------"
XC_ASSETS="$(find "$DIRECTORY" -name '*.xcassets')"
for xcasset in $XC_ASSETS; do
echo "-- 📦 XC Asset: $xcasset"