Skip to content

Instantly share code, notes, and snippets.

View gabrielfeitosa's full-sized avatar
🖥️

Gabriel Feitosa gabrielfeitosa

🖥️
View GitHub Profile
@gabrielfeitosa
gabrielfeitosa / docker-compose.yml
Created April 16, 2021 00:38
docker-compose samples
version: '3'
services:
postgres:
image: postgres
environment:
POSTGRES_PASSWORD: "abcde"
ports:
- "15432:5432"
volumes:
@gabrielfeitosa
gabrielfeitosa / config.env
Created September 25, 2020 18:55
Blue/Green deployment (Traefik, docker)
ENVIRONMENT=dev
OTHER_CONFIG=BLAH
@gabrielfeitosa
gabrielfeitosa / app.js
Last active October 11, 2016 02:35
Padronização dos componentes com AngularJS
(function () {
angular.module('app', [])
.directive('botao', function () {
return {
restrict: 'E',
replace: true,
scope: {
label: '@',
tipo: '@',
@gabrielfeitosa
gabrielfeitosa / travis.yml
Created June 18, 2016 20:06
Integração Contínua
language: java
jdk:
- oraclejdk8
deploy:
provider: heroku
api-key:
secure: $HEROKU_API_KEY
app: ci-spring-boot
@gabrielfeitosa
gabrielfeitosa / app.js
Last active May 19, 2016 15:41
Diretiva para controlar o acesso a elementos html
(function(){
angular.module('acesso',[])
.directive('permissaoAcesso', function(){
return {
restrict: 'A',
link: function ($scope, element, attrs) {
if (attrs.permissaoAcesso === 'block') {
element.attr('disabled', 'disabled');
element.append('<span class="block fa fa-lock"></span>');
@gabrielfeitosa
gabrielfeitosa / index.html
Last active January 20, 2016 12:02
Formulário base para o post sobre validação
<!DOCTYPE html>
<html ng-app="app">
<head>
<meta charset="utf-8" />
<title>Blog do Gabriel Feitosa</title>
</head>
<body>
<h1>AngularJS: Validação de Formulário</h1>
<div ng-controller="CaixaController as vm">
<form name="form" novalidate ng-submit="vm.sacar()">
@gabrielfeitosa
gabrielfeitosa / controller.js
Last active December 29, 2015 13:41
Pedidos com socket.io
(function() {
'use strict';
angular.module('app')
.controller('LojaController', function($scope) {
var socket = io();
var vm = this;
vm.pedido = {};
vm.pedidos = [];
@gabrielfeitosa
gabrielfeitosa / chatfactory.js
Last active November 11, 2015 18:39
Chat Periodic Refresh
(function() {
angular.module("app")
.factory("ChatFactory", function($http, $timeout) {
var promise;
var URL = "http://gf-chat.herokuapp.com/rest/mensagens/";
var mensagens = [];
var aberto = false;
var contador = 5;
return {
@gabrielfeitosa
gabrielfeitosa / bower.json
Last active September 25, 2015 02:27
Arquivo exemplo do bower.json
{
"name": "bower-exemplo",
"version": "0.0.0",
"homepage": "https://github.com/gabrielfeitosa/blog_exemplos",
"authors": [
"Gabriel Feitosa <gabfeitosa@gmail.com>"
],
"description": "",
"main": "",
"moduleType": [],
@gabrielfeitosa
gabrielfeitosa / app.js
Last active September 18, 2015 11:53
AngularJS: Filtros
(function() {
'use strict';
angular.module('app-filters', []);
angular.module('app-filters').filter('cpf', function() {
return function(input) {
var str = input + '';
if(str.length <= 11){
str = str.replace(/\D/g, '');
str = str.replace(/(\d{3})(\d)/, "$1.$2");