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 / 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 February 20, 2020 08:07
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(
@rhuanbarreto
rhuanbarreto / command.sh
Created November 16, 2018 14:09
Delete all local untracked branches from git
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d