With HTTP everything is visible when traveling on the Internet. By generating an SSL certificate and configuring your webserver you can force browsers to use HTTPS. Here is how to proceed:
# 1. Install letsencrypt
sudo pip install letsencrypt
# The atom cli tool provides a command for installing packages | |
# that you have previously starred. Once you all you pakackages | |
# are starred installing is super easy `apm stars --install`. | |
# This little command unstars all packages in your profile | |
# and start only the ones you have installed. | |
# For this to work you need jq `brew install jq`. | |
alias atomstars='apm unstar $(apm stars --json | jq -r ".[].name") && apm star --installed' |
// http://www.antimath.info/css/sass-sqrt-function/ | |
@function sqrt($r) { | |
$x0: 1; | |
$x1: $x0; | |
@for $i from 1 through 10 { | |
$x1: $x0 - ($x0 * $x0 - abs($r)) / (2 * $x0); | |
$x0: $x1; | |
} |
All the pieces of authentication are possible in Gatsby. Thanks to Auth0, setting it up doesn't have to be so cumbersome!
This setup comes straight from Auth0's official quick start for React.
The first step is installing the official Auth0 SDK for JavaScript from npm.
#!/bin/bash | |
HOME="http://www.yourdomain.com/some/page" | |
DOMAINS="yourdomain.com" | |
DEPTH=2 | |
OUTPUT="./urls.csv" | |
wget -r --spider --delete-after --force-html -D "$DOMAINS" -l $DEPTH "$HOME" 2>&1 \ | |
| grep '^--' | awk '{ print $3 }' | grep -v '\. \(css\|js\|png\|gif\|jpg\)$' | sort | uniq > $OUTPUT |
<?php | |
// Code goes in theme functions.php or a custom plugin | |
add_filter( 'pre_option_woocommerce_enable_guest_checkout', 'conditional_guest_checkout_based_on_product' ); | |
function conditional_guest_checkout_based_on_product( $value ) { | |
$restrict_ids = array( 1, 2, 3 ); // Replace with product ids which cannot use guest checkout | |
if ( WC()->cart ) { | |
$cart = WC()->cart->get_cart(); |
import * as React from "react" | |
import { useState, useEffect } from "react" | |
// Hook | |
let cachedScripts = [] | |
export function useScript(src) { | |
// Keeping track of script loaded and error state | |
const [state, setState] = useState({ | |
loaded: false, |