Skip to content

Instantly share code, notes, and snippets.

View lmcarreiro's full-sized avatar

Leonardo Carreiro lmcarreiro

View GitHub Profile
@lmcarreiro
lmcarreiro / .gitlab-ci.yml
Created June 11, 2018 13:36
GitLab CI .gitlab-ci.yml example
stages:
- build
- test
- deploy
variables:
# from https://storage.googleapis.com/kubernetes-release/release/stable.txt
K8S_STABLE_VERSION_URL: https://storage.googleapis.com/kubernetes-release/release/v1.10.4/bin/linux/amd64/kubectl
build:
@lmcarreiro
lmcarreiro / k8s-deploy-dev.yml
Created August 17, 2018 22:36
Exemplo kubernetes deploy
apiVersion: v1
kind: Service
metadata:
name: ###NAME###-service
labels:
name: ###NAME###-service
environment: dev
spec:
type: LoadBalancer
loadBalancerIP: ###LOAD_BALANCER_IP###
@lmcarreiro
lmcarreiro / .gitlab-ci.yml
Created August 17, 2018 22:39
Exemplo kubernetes deploy (pelo gitlab)
deploy_dev:
stage: deploy
dependencies:
- test
environment:
name: Development
image: alpine
script:
# Environment variables
- export DOMAIN=$(echo "$CI_ENVIRONMENT_URL" | sed -e 's|^https://||;s|/.*$||')
@lmcarreiro
lmcarreiro / curl
Last active August 22, 2018 18:02
curl 'http://ecoporanga2.uo-es.petrobras.com.br:31091/api/Geo/SalvarCoordenadas' -H 'Origin: http://ecoporanga2.uo-es.petrobras.com.br:31091' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9,pt-BR;q=0.8,pt;q=0.7' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36' -H 'Content-Type: application/json' -H 'Accept: */*' -H 'Referer: http://ecoporanga2.uo-es.petrobras.com.br:31091/prototipo2' -H 'Cookie: _ga=GA1.3.1116397345.1524857640; STDefaultServiceProvider=com.polycom.dma.tcspi.DmaConferenceService; lconn.profiles.sametime.currentStatus=1; _gid=GA1.3.199963334.1534949731' -H 'Connection: keep-alive' --data-binary '{"Video":"","Ducarao":0,"Imagem":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAUsAAAAvCAYAAABqpehmAAAF3UlEQVR4Xu2c67LcIAyDd9//oU8nbTOTZgKSQGazjfqzx/jy2QhIL+/X6/Xzyq8QCIEQCIEugXfEMhMSAiEQAphAxBIzikUIhEAIvCKWGYIQCIEQIAhELAlIMQmBEAiBiGVmIARCIAQIAhFLAlJMQiAEQiBimRkIgRAIAYJAxJKAFJMQCIEQiFhmBkIgBEKAIB
@lmcarreiro
lmcarreiro / package.json
Created January 25, 2019 16:00
bug on yarn install inside docker container (node:10.15.0 image) without proxy
{
"name": "mope-web-client",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
@lmcarreiro
lmcarreiro / test-args.sh
Created February 11, 2019 15:19
Bash script to get named arguments
#!/bin/bash
# File: test-args.sh
#
# Test with:
# ./test-args.sh --a1 a1 --a2 "a 2" --a3 --a4= --a5=a5 --a6="a 6"
#
# Output:
# a1 = "a1"
# a2 = "a 2"
@lmcarreiro
lmcarreiro / Program.cs
Created February 21, 2019 16:41
Get list of Access Point (BSSID and Signal) using C#
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@lmcarreiro
lmcarreiro / excel-workbook.yaml
Created March 6, 2019 18:33
Proposal of a excel workbook using a readable YAML text file structure
%YAML 1.2
%TAG !excel! tag:microsoft.com,2019:excel/
%TAG !w3c! tag:w3.org,2000:
--- !excel!workbook
Metadata:
Authors: Leonardo Machado Carreiro
Last saved by: Leonardo Machado Carreiro
Program name: Microsoft Excel
@lmcarreiro
lmcarreiro / webpack.config.js
Created June 3, 2019 17:59
Webpack error with multiple configurations
// @ts-check
const webpack = require('webpack');
const path = require('path');
const nodeExternals = require('webpack-node-externals');
const HtmlWebPackPlugin = require("html-webpack-plugin");
module.exports = [clientConfig, serverConfig]; // Array of functions that returns the object fails
//module.exports = env => [clientConfig(env), serverConfig(env)]; // Function that return an array of objects fails
//module.exports = [clientConfig(), serverConfig()]; // Array of objects fails
@lmcarreiro
lmcarreiro / index.js
Last active June 5, 2019 12:46
Webpack error with multiple configurations and --info-verbosity verbose
console.log("client");