Skip to content

Instantly share code, notes, and snippets.

View pedro-mass's full-sized avatar

Pedro Mass pedro-mass

View GitHub Profile
@pedro-mass
pedro-mass / test-helpers.js
Last active March 3, 2024 20:05
Test Helpers
// @ts-check
// ref: https://github.com/pedro-mass/learn/blob/b07f49b56802646e4e05137a0ff77219508c29c8/javascript/code-katas/src/test-helpers.js
import React from "react";
import partial from "lodash/partial";
import { Provider } from "react-redux";
import { createStore } from "./redux/store";
import { arrayify } from "./utils/array";
export { createStore };
@pedro-mass
pedro-mass / scroll-containers.js
Last active January 2, 2024 22:14
CSS Helpers
// Replace “.the-fixed-child” for a CSS selector
// that matches the fixed-position element:
const selector = ".fixed";
function findCulprits(elem) {
if (!elem) {
throw new Error(`Could not find element with selector: "${selector}"`);
}
let parent = elem.parentElement;
@pedro-mass
pedro-mass / .profile
Last active February 1, 2024 17:02
dev profile file
echo "loading profile..."
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
@pedro-mass
pedro-mass / create-heroku-env-update.js
Last active December 11, 2023 21:11
Generate commands for setting Heroku ENV from .env
// given .env file
// generate heroku env set commands to be run in heroku cli
// usage: node scripts/create-heroku-env-update.js .env app1,app2
const fs = require("fs");
const envFile = process.argv[2];
const env = fs.readFileSync(envFile, "utf8");
const envVars = env
@pedro-mass
pedro-mass / POST Get branch quotes - Single Mocked.json
Created September 25, 2023 20:49
POST Get branch quotes - Single Mocked
{
"version": 1,
"variables": [
{
"title": "getBranchQuotesData",
"dataclips": "https://data.heroku.com/dataclips/svnrbqwytkkgvfehgzjjezfpqpjb",
"values": [
[
"0053c00000DY0ljAAD",
"HomeAuto",
{
"url": "https://gist.github.com/pedro-mass/84ccd392c5e97e33328ffc992133cef9",
"version": 1,
"variables": [
{
"names": [
"accountid",
"contactid",
"lob",
"assignmentType"
@pedro-mass
pedro-mass / random-9.1.json
Last active February 6, 2024 22:38
random-9.1
{
"url": "https://gist.github.com/pedro-mass/24ad39369b6bd1ad6fa40b869ebc7447",
"title": "Get Flood Quotes",
"keys": ["quoteId", "count"],
"values": [
["000aff85-5dd5-4451-b72f-0b59eaaa732f", 2],
["000b1219-ab78-41b8-8e31-72e07214b6d5", 2],
["000b138a-b1e8-4a76-8e26-8ee0caa41cdf", 2],
["000b5dff-5cf8-4399-89f1-a645a1f26458", 2],
["000b86c5-f47c-4751-be0a-00e304ac6eb3", 1],
@pedro-mass
pedro-mass / Get or Create Contact in SF.json
Created August 30, 2023 17:26
Get or Create Contact in SF
{
"version": 1,
"variables": [
{
"title": "Get or Create Contact in SF",
"names": ["email", "first_name", "last_name"],
"values": [
["[email protected]", "Lakshmi", "Burujula"],
["[email protected]", "Miguel", "Fenrick"],
["[email protected]", "Ibrahim", "Ninalowo"],
@pedro-mass
pedro-mass / get Home Quote details.json
Last active February 6, 2024 22:38
get Home Quote details
{
"title": "get Home Quote details",
"keys": ["quoteId"],
"values": [
["9f6c9828-6386-4897-b004-fa1919a9c639"],
["3f2a9722-95ac-456e-821b-b27ee6d95fe9"],
["9f1d671d-cd28-4a15-bf04-ddf25e67a073"],
["233a2419-85bb-4738-844d-63da3bf7c9fd"],
["3073c20e-b570-4571-8790-d3de0e0b064c"],
["b88c5724-b5cc-411a-9d2a-522a2aa9fd68"],