Skip to content

Instantly share code, notes, and snippets.

View 1fabiopereira's full-sized avatar
👨‍💻
Working from home

Fábio Pereira 1fabiopereira

👨‍💻
Working from home
  • Guaratinguetá - SP, Brazil
View GitHub Profile
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.example.http.authenticate;
import java.io.*;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
/*
* Módulo Nodejs para formatar CPF
*/
'use strict';
module.exports = cpf => {
const _format = value => {
return value.substring(0, 3) + '.' +
value.substring(3, 6) + '.' +
value.substring(6, 9) + '-' +
value.substring(9, 11);
@1fabiopereira
1fabiopereira / microservice-seneca-express.md
Created November 11, 2016 15:06 — forked from umidjons/microservice-seneca-express.md
Simple microservice with Seneca and Express

Simple microservice with Seneca and Express

Microservice implementation

Installing microservice dependencies

mkdir mathms
cd mathms
npm init
@1fabiopereira
1fabiopereira / log
Created November 12, 2016 16:10
seneca-web bug
Seneca Fatal Error
==================
Message: seneca: No matching action pattern found for { use: { prefix: '/api', pin: 'role:api,path:*', map: { calculate: [Object] } }, role: 'web' }, and no default result provided (using a default$ property).
Code: act_not_found
Details: { args: '{ use: { prefix: \'/api\', pin: \'role:api,path:*\', map: { calculate: [Object] } }, role: \'web\' }',
plugin: {} }
@1fabiopereira
1fabiopereira / lazy.js
Last active January 6, 2017 18:45
Carregamento preguiçoso usando web worker - https://github.com/mattslocum/ng-webworker
(function () {
'use strict';
angular.module('clusbe.diretiva.lazy', [])
.directive('lazy', [
'$http',
'$timeout',
'Webworker',
'CONSTANT_RESOURCES_URL_IMG',
'CONSTANT_BASE_URL',
'$window',
@1fabiopereira
1fabiopereira / random.js
Last active January 11, 2017 17:33
Test
'use strict';
const anuncios = [{"id_anuncio":"14","anuncio_nome":"Banner Yamaha","img":"uploads\/2016\/10\/banner-yamaha-topo.jpg","resp":"uploads\/2016\/09\/banner-yamaha-m1.jpgYAMAHARESPONSIVOCORRETO.jpg","link":"http:\/\/www.yamaha-nautica.com.br\/ofertas\/","prioridade":"3"},{"id_anuncio":"14","anuncio_nome":"Banner Yamaha","img":"uploads\/2016\/10\/banner-yamaha-topo.jpg","resp":"uploads\/2016\/09\/banner-yamaha-m1.jpgYAMAHARESPONSIVOCORRETO.jpg","link":"http:\/\/www.yamaha-nautica.com.br\/ofertas\/","prioridade":"3"},{"id_anuncio":"14","anuncio_nome":"Banner Yamaha","img":"uploads\/2016\/10\/banner-yamaha-topo.jpg","resp":"uploads\/2016\/09\/banner-yamaha-m1.jpgYAMAHARESPONSIVOCORRETO.jpg","link":"http:\/\/www.yamaha-nautica.com.br\/ofertas\/","prioridade":"3"},{"id_anuncio":"21","anuncio_nome":"Banner Yamaha","img":"uploads\/2016\/10\/banner-yamaha-topo2.jpg","resp":"uploads\/2016\/09\/banner-yamaha-m1-2.jpg","link":"http:\/\/www.yamaha-nautica.com.br\/ofertas\/","prioridade":"1"},{"id_anuncio":"22",
@1fabiopereira
1fabiopereira / architecture.js
Last active February 20, 2017 17:36
Simple mobile detect architecture
class AndroidArchitecture{
static getArchitecture(){
let architecture;
if(navigator.platform.indexOf('i686') !== -1){
architecture = '32-bits';
} else if(navigator.platform.indexOf('armv8l') !== -1){
architecture = '64-bits';
}
@1fabiopereira
1fabiopereira / restapi.js
Created April 27, 2017 11:18 — forked from yeco/restapi.js
Rest API Adapter for Titanium Alloy
/**
* Rest API Adapter for Titanium Alloy
*/
function S4() {
return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
}
function guid() {
return S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4();
@1fabiopereira
1fabiopereira / PackageApplication
Created June 13, 2017 12:44
PackageApplication script from Xcode 8.2.1
#!/usr/bin/perl
#
# PackageApplication
#
# Copyright (c) 2009-2012 Apple Inc. All rights reserved.
#
# Package an iPhone Application into an .ipa wrapper
#
use Pod::Usage;

Ao compilar o aplicativo com o novo SDK fornecido tenho a seguinte saida de erro no console:

[ERROR] Failed to run dexer:
[ERROR]   
[ERROR] trouble writing output: Too many method references: 70731; max is 65536.
[ERROR] You may try using --multi-dex option.
[ERROR] References by package:
[ERROR]      6 android.accessibilityservice
[ERROR]      9 android.accounts