Skip to content

Instantly share code, notes, and snippets.

View rhuanbarreto's full-sized avatar
😃
Coding @t60digital!

Rhuan Barreto rhuanbarreto

😃
Coding @t60digital!
View GitHub Profile
@rhuanbarreto
rhuanbarreto / create_mtls_certs.sh
Created September 22, 2024 08:56
Create mTLS certs for your application
# Setup
CUSTOMER="customer-name"
COUNTRY="NO"
CACHE_SERVER_FQDN="remote-cache.example.com"
# CA Certificate
# Step 1: Create CA private key
openssl genpkey -algorithm RSA -out ca_private_key.pem -pkeyopt rsa_keygen_bits:4096
# Step 2: Create CA certificate
@rhuanbarreto
rhuanbarreto / pipeline.yaml
Created January 22, 2024 14:49
Deployment Pipeline for docker images using Pants in Azure Dev Ops
name: Deploy Functions
trigger:
- main
variables:
- group: Pulumi
- name: npm_config_cache
value: $(Pipeline.Workspace)/.npm
pool:
@rhuanbarreto
rhuanbarreto / visual-testing.yaml
Created July 29, 2022 17:32
Github Workflow For Chromatic
name: Visual Testing
on:
push:
branches:
- master
pull_request:
types:
- opened
- reopened
@rhuanbarreto
rhuanbarreto / pprt.js
Created June 2, 2021 10:50
Get first page of current browser puppeteer
const page = (await browser.pages())[0];
@rhuanbarreto
rhuanbarreto / upload_sourcemaps.js
Created November 25, 2020 13:55
Script to Upload Source and Source Maps to Bugsnag
/**
* # Instructions
* Run `BUGSNAG_KEY=vnjekfnvjkfeve APP_VERSION=1.0.0 PUBLIC_URL=https://example.com node upload_sourcemaps.js`
* to upload all sources to Bugsnag. This is very useful if your source is behind a firewall and Bugnsag can't access it
*/
const path = require("path");
const upload = require("bugsnag-sourcemaps").upload;
const walkSync = require("walk-sync");
@rhuanbarreto
rhuanbarreto / script.sh
Created June 10, 2020 07:53
Kill Defunct Processes in Linux
ps -ef | grep defunct | grep -v grep | cut -b8-20 | xargs sudo kill -9
@rhuanbarreto
rhuanbarreto / countries.json
Last active May 15, 2020 10:33 — forked from avlisodraude/countries.json
A list of countries in JSON
{
"rows": [
{ "name": "Afghanistan", "code": "AF" },
{ "name": "Åland Islands", "code": "AX" },
{ "name": "Albania", "code": "AL" },
{ "name": "Algeria", "code": "DZ" },
{ "name": "American Samoa", "code": "AS" },
{ "name": "AndorrA", "code": "AD" },
{ "name": "Angola", "code": "AO" },
{ "name": "Anguilla", "code": "AI" },
@rhuanbarreto
rhuanbarreto / script.sh
Created April 7, 2020 11:09
Install pg gem without database in Mac os
brew install libpq
bundle config --local build.pg --with-opt-dir="/usr/local/opt/libpq"
bundle install
@rhuanbarreto
rhuanbarreto / queryStringSerialize.js
Last active July 3, 2024 10:28
Serialize deep objects to URL Search Parameters query string
export const queryStringSerialize = (obj, prefix) => {
var str = [],
p;
for (p in obj) {
if (obj.hasOwnProperty(p)) {
var key = isNaN(parseInt(p, 10)) ? p : "";
var k = prefix ? prefix + "[" + key + "]" : p;
var v = obj[p];
str.push(
v !== null && typeof v === "object"
@rhuanbarreto
rhuanbarreto / store.js
Created January 9, 2019 04:13
Configure Redux DevTools with Redux Offline
import { createStore, compose } from "redux";
import rootReducer from "./reducers";
import { offline } from '@redux-offline/redux-offline';
import config from '@redux-offline/redux-offline/lib/config';
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
export default createStore(
rootReducer,
composeEnhancers(