Skip to content

Instantly share code, notes, and snippets.

View robwierzbowski's full-sized avatar

Rob Wierzbowski robwierzbowski

View GitHub Profile
{
"$schema": "http://json-schema.org/draft-07/schema#",
"anyOf": [
{
"$ref": "#/definitions/{name:\"order\"|\"categories\"|\"exchange\"|\"freestyle\"|\"homefeed\"|\"post_checkout_promo\"|\"return\"|\"shopping_bag\"|\"storybook\";schema:\"screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";}"
},
{
"$ref": "#/definitions/{name:\"buy_it_again_index\"|\"category\"|\"collections_index\"|\"kept_items_index\"|\"saved_items_index\";schema:\"category_screen_view\";locale:\"en-GB\"|\"en-US\";region:\"UK\"|\"US\";source_app:\"android\"|\"storybook\"|\"home-ui\"|\"kept-items-ui\"|\"shop-collections-ui\";category_id:string;}"
},
{
@robwierzbowski
robwierzbowski / husky-to-simple-git-hooks.sh
Created May 18, 2022 15:26
Convert Husky to Simple Git Hooks
rm -f .huskyrc.js
cat > .simple-git-hooks.js << EOF
const { simpleGitHooks } = require('@stitch-fix/kufak-fe-infra');
module.exports = simpleGitHooks;
EOF
@robwierzbowski
robwierzbowski / App.jsx
Last active April 18, 2023 20:44
Solution
import { useEffect, useState } from 'react';
// returns the state of *all* features for current user
const fetchAllFeatures = () =>
// in reality, this would have been a `fetch` call:
// `fetch("/api/features/all")`
// Executes once
// console.log('fetch called');
@robwierzbowski
robwierzbowski / switch_to_npm_registry.sh
Last active July 18, 2023 16:46
Configure yarn to use the npm registry directly
#!/bin/bash
# Remove all settings in the .npmrc except the required auth token setting.
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
# Create a new .yarnrc that specifies the npm registry, or append to an existing one.
echo 'registry: https://registry.npmjs.org/' >> .yarnrc
# Remove and regenerate the yarn.lock. This should be identical to running `yarn upgrade`.
# If you are uncomfortable regenerating the yarn.lock file, you can comment out the next
@robwierzbowski
robwierzbowski / gitcreate.sh
Last active August 8, 2023 07:31
A simple litte script. Create and push to a new github repo from the command line.
#!/bin/bash
# https://gist.github.com/robwierzbowski/5430952/
# Create and push to a new github repo from the command line.
# Grabs sensible defaults from the containing folder and `.gitconfig`.
# Refinements welcome.
# Gather constant vars
CURRENTDIR=${PWD##*/}
GITHUBUSER=$(git config github.user)