Skip to content

Instantly share code, notes, and snippets.

💭
I may be slow to respond.

Pedro Brasileiro pedrobrasileiro

💭
I may be slow to respond.
Block or report user

Report or block pedrobrasileiro

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View estados-cidades.json
{
"estados": [
{
"sigla": "AC",
"nome": "Acre",
"cidades": [
"Acrelândia",
"Assis Brasil",
"Brasiléia",
"Bujari",
View gist:30e7a4071881e2d221719dadafebee5f
function _uploadProfileImage(params) {
var d = $q.defer();
function onUploadSuccess(result) {
console.log("result uploa image profile ==>> "+ JSON.stringify(result));
d.resolve(result.data);
}
function onUploadFail(error) {
// 1 = FileTransferError.FILE_NOT_FOUND_ERR
View gist:893721901e4671e1bba72ce77d843d2e
function _openCamera() {
var options = _getOptionsCamera(Camera.PictureSourceType.CAMERA);
$cordovaCamera.getPicture(options).then(function(imageUrl) {
UserSrv.uploadProfileImage({
image : imageUrl
}).then(function(image) { // jshint ignore:line
console.log("image => "+ JSON.stringify(image));
}).catch(function(err) { // jshint ignore:line
// console.error("error upload => "+ JSON.stringify(err));
View gist:eb381dec0c47bae1efea6bafb2b00147
function _getOptionsCamera(sourceType) {
var _cameraPopover = new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
return {
quality: 90,
destinationType: Camera.DestinationType.FILE_URI,
sourceType: sourceType,
mediaType: Camera.MediaType.PICTURE,
allowEdit: true,
encodingType: ionic.Platform.isAndroid()?Camera.EncodingType.JPEG:Camera.EncodingType.PNG,
View error.html
<html>
<head>
<title>Focus-in APIs</title>
<meta charset="UTF-8">
</head>
<body style="margin: 0px; padding: 0px;">
<a name="top"></a>
<h1>API</h1>
<b>Mensagem Boas Vindas</b>
View fourSquareAPI.js
/*
Author: James Shrager (@jshrager)
Intended use: Appcelerator Titanium
Usage: http://www.LearningTitanium.com (@learningTi)
*/
var client_id = "YOUR_CLIENT_ID";
var client_secret = "YOUR_CLIENT_SECRET";
var redirectUri = 'http://YOUR_URL/foursquareCallback.php';
var ui = require('ui/ui');
View ChangePassword.java
import java.util.*;
import java.io.*;
import java.security.*;
public class ChangePassword
{
private final static JKS j = new JKS();
public static void main(String[] args) throws Exception
{
View genymotionwithplay.txt
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)
Google Apps for Android 4.4.4 (https://www.androidfilehost.com/?fid=23311191640114013)
Google Apps for Android 4.3 (https://www.androidfilehost.com/?fid=23060877490000124 - gapps-jb-20130813-signed.zip)
Google Apps for Android 4.2 (https://www.androidfilehost.com/?fid=23060877490000128 - gapps-jb-20130812-signed.zip)
Google Apps for Android 4.1 (https://www.androidfilehost.com/?fid=22979706399755082 - gapps-jb-20121011-signed.zip)
View gist:a545a687fed173557a37
var http = Ti.Network.createHTTPClient({
onerror : function(e) {
console.error('Error Send Photo : '+ e);
args.error(e);
},
onload : function () {
console.debug('Success Send Photo : '+ JSON.stringify(data));
args.success({responseText : this.responseText});
},
onsendstream : function(e) {
View gist:10337061
Alloy.Globals.Facebook = {};
Object.defineProperty(Alloy.Globals.Facebook, 'dataLogin', {
get: function() {
var dataLogin = Ti.App.Properties.getString('facebookDataLogin', null);
return dataLogin===null?null:JSON.parse(dataLogin);
},
set: function(dataLogin) {
Ti.App.Properties.setString('facebookDataLogin', JSON.stringify(dataLogin));
}
You can’t perform that action at this time.