Skip to content

Instantly share code, notes, and snippets.

View GlauberF's full-sized avatar
🎯
Foco e determinação nos objetivos.

Glauber Funez GlauberF

🎯
Foco e determinação nos objetivos.
View GitHub Profile
.then((d) => {
let respSuccess = {};
respSuccess.pessoas = d;
// tb endereço
if (objEndereco.endcli_logradouro || objEndereco.endcli_cep || objEndereco.endcli_bairro ||
objEndereco.endcli_pais || objEndereco.endcli_cidade || objEndereco.endcli_estado ||
objEndereco.endcli_numero || objEndereco.endcli_complemento) {
knex('tb_Endereco_Cliente')
@GlauberF
GlauberF / duvida.js
Created July 6, 2017 18:11
scope nodejs
.then((daAtualizado) => {
pessoas
.forge({
cli_id: person.attributes.id
})
.fetch()
.then((d) => {
// instancio o objeto que irá receber os valores
let respSuccess = {};
.then((pessoasData) => {
const list = pessoasData.map((data, i) => {
var objetoSend = {};
objetoSend.pessoas = [{
"cli_id": data.cli_id,
"fk_saas_id": data.fk_saas_id,
"fk_user_id": data.fk_user_id,
"cli_nome": data.cli_nome,
"cli_email": data.cli_email,
(function ()
{
'use strict';
angular
.module('app.tabelasFixas.cest')
.controller('CestController', CestController);
/** @ngInject */
function CestController($state, Cest, $timeout, $http, $log)
@GlauberF
GlauberF / localStorageService.expire.js
Created July 28, 2017 18:08 — forked from Kyoss79/localStorageService.expire.js
Extend the localStorageService for Angular (https://github.com/grevory/angular-local-storage) with the possibility of expiring entries.
/**
* extend the localStorageService (https://github.com/grevory/angular-local-storage)
*
* - now its possible that data stored in localStorage can expire and will be deleted automagically
* - usage localStorageService.set(key, val, expire)
* - expire is an integer defininig after how many hours the value expires
* - when it expires, it is deleted from the localStorage
*/
app.config(($provide) => {
$provide.decorator('localStorageService', ($delegate) => {
@GlauberF
GlauberF / example.html
Created August 2, 2017 17:12 — forked from 981746/example.html
A simple AngularJS service for handling the 'onbeforeunload' event
<!DOCTYPE html>
<html data-ng-app="TestApp">
<head>
<script src="http://code.angularjs.org/1.2.9/angular.js"></script>
<script>
angular.module('TestApp', [])
.factory('beforeUnload', function ($rootScope, $window) {
// Events are broadcast outside the Scope Lifecycle
@GlauberF
GlauberF / angularjs-providers-explained.md
Created August 18, 2017 14:41 — forked from demisx/angularjs-providers-explained.md
AngularJS Providers: Constant/Value/Service/Factory/Decorator/Provider
Provider Singleton Instantiable Configurable
Constant Yes No No
Value Yes No No
Service Yes No No
Factory Yes Yes No
Decorator Yes No? No
Provider Yes Yes Yes

Constant

@GlauberF
GlauberF / converteEstado.js
Last active June 20, 2020 19:56
Função em javascript que converte a Sigla do estado para o Nome do estado - (padrão americano sem acentos)
/**
* Converter estados - (padrão americano sem acentos) - Glauber Funez
**/
const ConverterEstados = function(val) {
var data;
switch (val.toUpperCase()) {
case "AC" : data = "Acre"; break;
case "AL" : data = "Alagoas"; break;
case "AM" : data = "Amazonas"; break;
@GlauberF
GlauberF / Configuracao LAMP com PHP 7.1 no Deepin
Last active June 4, 2021 04:31
Comandos para instalacao do LAMP no Deepin, com PHP 7.1
## ATUALIZAR OS
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade
## INSTALAR O MYSQL-SERVER
sudo apt-get install mysql-server
## INSTALAR O APACHE2
sudo apt-get install apache2
## CHECAR VERSAO DO PHP NO REPOSITORIO