Skip to content

Instantly share code, notes, and snippets.

Adilson Carvalho adilsoncarvalho

Block or report user

Report or block adilsoncarvalho

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@adilsoncarvalho
adilsoncarvalho / README.md
Created Feb 18, 2019
My Visual Studio Code (VSCode) Extensions
View README.md

My Visual Studio Code Extensions

How I extracted it from my VSCode

code --list-extensions | xargs -L 1 echo code --install-extension

The actual list

@adilsoncarvalho
adilsoncarvalho / gsutil-upload.sh
Created Oct 19, 2018 — forked from mraible/gsutil-upload.sh
Upload optimized assets to Google Cloud Storage
View gsutil-upload.sh
# Rsync to remove old files
gsutil -m rsync -x '.git*' -c -d -r dist gs://bucket/
# Upload and gzip HTML, CSS and JavaScript
gsutil -m cp -z "html,css,js" -r dist/** gs://bucket/
# Set expires headers (6 months) on JS and CSS assets
gsutil -m setmeta -h "Cache-Control: public, max-age=15552000" gs://bucket/assets/**
# Make sure there's no expiration headers on HTML files
@adilsoncarvalho
adilsoncarvalho / docker-compose.yml
Created Sep 13, 2018
Example of a docker-compose.yml mounting cloud_sql_proxy as a service
View docker-compose.yml
version: '3'
services:
app:
build: .
# your own configurations for that app
depends_on:
- cloud-sql-proxy
environment:
# You must set an URL to access your database. On sequelize (nodejs) it follows this
@adilsoncarvalho
adilsoncarvalho / logger.js
Created Sep 6, 2018
Winston -> GCP Logger
View logger.js
const Logging = require('@google-cloud/logging');
// Your Google Cloud Platform project ID
const projectId = 'wiseup-102030';
// Creates a client
const logging = new Logging({
projectId: projectId,
});
@adilsoncarvalho
adilsoncarvalho / variables.json
Created Aug 28, 2018
Google Cloud Functions default environment variables
View variables.json
{
"X_GOOGLE_CODE_LOCATION": "/user_code",
"WORKER_PORT": "8091",
"X_GOOGLE_SUPERVISOR_INTERNAL_PORT": "8081",
"X_GOOGLE_WORKER_PORT": "8091",
"FUNCTION_IDENTITY": "teretete@appspot.gserviceaccount.com",
"X_GOOGLE_LOAD_ON_START": "false",
"GCLOUD_PROJECT": "project-id",
"X_GOOGLE_FUNCTION_REGION": "us-central1",
"FUNCTION_NAME": "function-name",
@adilsoncarvalho
adilsoncarvalho / create-xlsx.js
Created May 27, 2018
Creating a xlsx file using the package xlsx
View create-xlsx.js
// More at: https://github.com/SheetJS/js-xlsx/blob/master/demos/server/express.js
import XLSX from 'xlsx';
// create a new workbook
const workbook = XLSX.utils.book_new();
// create a new worksheet
const worksheet = XSLX.utils.json_to_sheet([{ a: 1, b: false }]);
@adilsoncarvalho
adilsoncarvalho / LICENSE
Last active Mar 20, 2018
Goes back to master while pulling from origin and removing the local branches deleted on origin
View LICENSE
MIT License
Copyright (c) 2018 Adilson Luiz Carvalho
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@adilsoncarvalho
adilsoncarvalho / install.sh
Created Feb 26, 2018
All the Node lint packages for Visual Studio Code
View install.sh
#!/bin/bash
npm install -g \
eslint \
eslint-config-airbnb eslint-config-airbnb-base \
eslint-plugin-import eslint-plugin-jsx-a11y eslint-plugin-react \
babel-eslint
@adilsoncarvalho
adilsoncarvalho / README.md
Last active Jul 20, 2019
Deploying a firebase function from Bitbucket pipelines
View README.md

Deploying functions from Bitbucket Pipelines

It's quite easy and the same process applies to all Firebase features with minor changes.

Acquire a deployment token

In order to deploy you'll need a deployment token (I named it FIREBASE_TOKEN) and it can be acquired by using the following command

firebase login:ci
View keybase.md

Keybase proof

I hereby claim:

  • I am adilsoncarvalho on github.
  • I am adilson (https://keybase.io/adilson) on keybase.
  • I have a public key ASDJwuIJbFAMN6GIf7DwlZMoUMAwePS1OWsUGdDSaIAPzwo

To claim this, I am signing this object:

You can’t perform that action at this time.