Skip to content

Instantly share code, notes, and snippets.

View binho's full-sized avatar

Cleber Santos binho

View GitHub Profile
@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 / 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 / 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 / vertical_block.html
Created January 21, 2014 10:24
bloqueia site na vertical
<!-- CSS -->
<style type="text/css">
/* verifica se esta na vertical ou horizontal */
#aviso-vertical { display: none; background:red; color:white; padding:20px; margin-top:100px; }
#aviso-vertical p { text-align:center; font-family: 'Trebuchet MS'; margin-left: -295px; font-size:22px; }
@media only screen and (orientation:portrait) {
#container { display:none; }
#aviso-vertical { display:block; }
}
@media only screen and (orientation:landscape) {
@binho
binho / android.sh
Last active December 30, 2015 05:59
Gerar chave para validação Android
# generate key example
keytool -genkey -v -keystore maxwal.keystore -alias maxwal -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Maxwal, OU=Maxwal, S=São Paulo, C=BR"
@binho
binho / debug_objc.m
Last active December 19, 2015 18:08
debug no objctive-c do nome do arquivo e linha
NSLog(@"[%s:%s:%d]", __FUNCTION__, __FILE__, __LINE__);
@binho
binho / nodejs80
Created March 2, 2013 00:35
rodar nodejs na porta 80 junto com apache
<VirtualHost cabine.la:80>
ServerAdmin contato@cabine.la
ServerName www.cabine.la
ServerAlias cabine.la
DocumentRoot /var/www/cabine
ProxyRequests off
<Proxy *>
Order deny,allow
Allow from all
public void validateApp()
{
try {
HttpPost request = new HttpPost("http://binho.net/p/teste.json");
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(6);
nameValuePairs.add(new BasicNameValuePair("user_email", "positivo@positivo.com.br"));
nameValuePairs.add(new BasicNameValuePair("user_password", "123456"));
nameValuePairs.add(new BasicNameValuePair("application_id", APP_ID));
nameValuePairs.add(new BasicNameValuePair("device_id", obtemID()));
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')
@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",