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 / 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 / gist:1020724
Created June 11, 2011 16:26
best way to toggle done button on UITextField and UITextView (iPhone)
/*
set the UITextField's and UITextView's delegates to file owners!
put at .h file
*/
id activeField;
@binho
binho / gist:2237952
Created March 29, 2012 14:26 — forked from l4u/gist:2233073
Layer Clipping cocos2d-x
//http://codewars.net/304/layer-clipping-in-cocos2d-x/
void CCClippingLayer::visit()
{
// quick return if not visible
if (!getIsVisible())
{
return;
}
@binho
binho / hack.sh
Created April 30, 2012 03:13 — forked from Mikimoto/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@binho
binho / momentjs_ptbr.js
Created August 10, 2012 19:03
moment javascript pt_br
moment.lang('en', {
months : "Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro".split("_"),
monthsShort : "Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),
weekdays : "Domingo_Segunda_Terça_Quarta_Quinta_Sexta_Sábado".split("_"),
weekdaysShort : "Dom_Seg_Ter_Qua_Qui_Sex_Sáb".split("_"),
longDateFormat : {
LT : "h:mm A",
L : "MM/DD/YYYY",
LL : "MMMM D YYYY",
LLL : "MMMM D YYYY LT",
import os, os.path, shutil
YUI_COMPRESSOR = 'yuicompressor-2.4.2.jar'
#_______________________________________________________________________
def compress(in_files, out_file, in_type='js', verbose=False, temp_file='.temp'):
temp = open(temp_file, 'w')