This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function findBreakoutElem(rootElem = document.body) { | |
function checkElemWidth(elem) { | |
if (elem.clientWidth > window.outerWidth) { | |
console.log("The following element has a larger width than the window's outer width"); | |
console.log(elem); | |
console.log('<-------------------------------------------------------------------->'); | |
} else if (elem.scrollWidth > window.outerWidth) { | |
console.log("The following element has a larger width than the window's scroll width"); | |
console.log(elem); | |
console.log('<-------------------------------------------------------------------->'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MIT © Santiago Greco - fsgreco@hey.com | |
# Set new folder to hooks | |
# In order to get this script working automatically (it triggers when user runs `npm install`): | |
# 1. place this script inside .githooks folder | |
# 2. set a script "prepare" on package.json with the command: .githooks/set-hooks.sh | |
HASHOOKPATH="$(git config core.hooksPath)" | |
if [[ -z "$HASHOOKPATH" ]]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MIT © Santiago Greco - fsgreco@hey.com | |
# | |
# What it does: | |
# If the site is already in production, instead of manually download all the files in upload folder | |
# your local apache server will search and use the production files if they are not found on localhost | |
# | |
# How to use it: | |
# Place this file inside your own localhost environment: `your_localhost/wp-content/uploads/.htaccess` | |
# Change "YOUR_DOMAIN.TLD" with your actual production domain name inside the RewriteRule line. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# MIT © Santiago Greco - fsgreco@hey.com | |
# This file set two bash functions that interact with github gist public API. It is made for single file gists. | |
# The first one "gist_list" retrieves a list of public gist from a given username (the only param you need to pass). | |
# The second one "download_gist" downloads the single gist file (need to have 2 params: username and gits_name) | |
function check_jq() { | |
if ! command -v jq &> /dev/null; then echo "Please install 'jq'." && exit 1; fi | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# MIT © Santiago Greco - fsgreco@hey.com | |
# This script fetches a list of active plugins from your production wordpress environment. | |
# Once it retrieves the list it creates a second script ready to run: `install-plugins.sh` | |
# | |
# For more context and information please consult the documentation of the entire project: | |
# docker-wordpress - https://github.com/fsgreco/docker-wordpress#sync-plugins | |
if ! command -v jq &> /dev/null; then echo "Please install 'jq'." && exit 1; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
/** | |
* MIT © Santiago Greco - fsgreco@hey.com | |
* This script fetches a list of active plugins from your production wordpress environment. | |
* The goal is to quickly install the same plugins on local environment (matching their version numbers). | |
* How it works: | |
* Once it retrieves the list it creates a second script (in bash) ready to run: `install-plugins.sh` | |
* The script generated consist on a set of instructions to install everything using wp-cli. | |
* This second script can be modified or adapted. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tm() { | |
just_name= | |
while getopts "n:" opt; do | |
case $opt in | |
n) just_name="$OPTARG" ;; | |
esac | |
done | |
# if you run `tm .` the directory name will be the name of the session | |
if [ "$1" = "." ] ; then just_name="$(basename "$PWD" | tr . _)"; fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tm() ( | |
[ -z "$1" ] && echo 'Please give me the name of the session' && exit 1 | |
# If there is no tmux server running create the session | |
[[ -z "$TMUX" && ! $(tmux ls 2> /dev/null) ]] && tmux new -s $1 && exit 0 | |
# There is at least a tmux server running | |
# If you're not inside tmux either attach to the session or create it: | |
[ -z "$TMUX" ] && tmux new -A -s $1 && exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"files.watcherExclude": { | |
"**/.git/objects/**": true, | |
"**/.git/subtree-cache/**": true, | |
"**/node_modules/**": true, | |
"**/package-lock.json": true, | |
"**/tmp/**": true, | |
"**/.git": true, | |
"**/.svn": true, | |
"**/node_modules": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import { graphql, StaticQuery } from 'gatsby' | |
import Product from './product.js' | |
const PRODUCTS_QUERY = graphql` | |
query allProducts { | |
allStripePrice(filter: {active: {eq: true}}) { | |
edges { | |
node { |