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 / DeployComGit.md
Last active May 2, 2018 18:30
Deploy com Git

Olá pessoal, tudo bem? Vamos aprender a configurar um deploy utiizando Git? É super tranquilo!

Primeiro você vai ter que instalar o Git na sua máquina e no servidor e para fazer isso basta entrar no site oficial do Git:

https://git-scm.com/

Vamos iniciar pelo servidor

  • No servidor você vai entrar usando ssh no diretório do seu projeto e criar uma pasta para o git com o comando:
@GlauberF
GlauberF / bancos_brasileiros.php
Created July 24, 2018 17:08 — forked from peuweb/bancos_brasileiros.php
Lista dos bancos brasileiros em formato array
<?php
//bancos brasileiros
$bancos = array(
array('code' => '001', 'name' => 'Banco do Brasil'),
array('code' => '003', 'name' => 'Banco da Amazônia'),
array('code' => '004', 'name' => 'Banco do Nordeste'),
array('code' => '021', 'name' => 'Banestes'),
array('code' => '025', 'name' => 'Banco Alfa'),
array('code' => '027', 'name' => 'Besc'),
array('code' => '029', 'name' => 'Banerj'),
@GlauberF
GlauberF / php7.1.md
Created August 2, 2018 02:35 — forked from VirtuBox/php7.1.md
How to install php7.1-fpm with EasyEngine

How to install php7.1-fpm with EasyEngine


Install php7.1-fpm

apt install php7.1-common php7.1-cli php7.1-zip php7.1-opcache php7.1-mysql php7.1-mcrypt php7.1-mbstring php7.1-json php7.1-intl php7.1-gd php7.1-fpm php7.1-curl php7.1-bz2

Copy the php7.1-fpm pool configuration from php7.0-fpm

cp -f /etc/php/7.0/fpm/pool.d/www.conf /etc/php/7.1/fpm/pool.d/www.conf