Note: This post is a summary of information paraphrased from an excellent blog post by Christian Sepulveda.
Create the app and download the necessary dependencies.
<?php | |
/* | |
A simple cache for remote files/URLs | |
2011 Carlo Alberto Ferraris <[email protected]> | |
=================================================== | |
The cache function allows you to get the contents of a remote URL at | |
most once every N seconds. It also supports the If-Modified-Since HTTP | |
header to avoid fetching the resource again if it hasn't changed. |
{ | |
"id": "c64a107a-39ab-27b4-9c37-d93b1e187589", | |
"name": "Copy API (REST)", | |
"description": "## API Calls\n\nThis is the meat and potatoes of this document. Here we'll discuss the various API calls you can make to our servers, along with what inputs we require, and what outputs you can expect back, and the required permissions to perform the request. Since this is a RESTful JSON API, you will need to know the URLs ahead of time.\n\nIn the URLs of the sample requests, words that appear in all CAPITAL letters represent the part of the URL which is meant to be changed by you, the developer, depending on the intention of your request.\n\n##### Request Headers\n\nYou will need to provide the following two HTTP request headers while talking to the Copy API:\n\n* **X-Api-Version**: 1\n* **Accept**: application/json\n\n##### Response Headers\n\nHere's a list of some typical response headers to expect from our server, most of which can be ignored.\n\n* **Access-Control-Allow-Headers**: X-AUTHORIZATION-ANON, |
var obj = { | |
konamiCodeActive: false, | |
konamiCodeListener: function() { | |
if ( window.addEventListener ) { | |
var kkeys = [], konami = "38,38,40,40,37,39,37,39,66,65"; | |
window.addEventListener("keydown", function(e){ | |
kkeys.push( e.keyCode ); | |
if ( kkeys.toString().indexOf( konami ) >= 0 && !obj.konamiCodeActive) { | |
obj.konamiCodeActive = true; | |
Create the app and download the necessary dependencies.
#!/bin/bash | |
# Usage | |
# $ ./install-cert-macos.sh "/path/to/cert" | |
CERT_PATH="$1" | |
# First, grab the SHA-1 from the provided SSL cert. | |
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g") | |
# Next, grab the SHA-1s of any standard.dev certs in the keychain. | |
# Don't return an error code if nothing is found. |
/* | |
Copy this into the console of any web page that is interactive and doesn't | |
do hard reloads. You will hear your DOM changes as different pitches of | |
audio. | |
I have found this interesting for debugging, but also fun to hear web pages | |
render like UIs do in movies. | |
*/ | |
const audioCtx = new (window.AudioContext || window.webkitAudioContext)() |
import React, { createContext, useContext } from "react" | |
import useSWR from "swr" | |
const AuthContext = createContext(false) | |
export const AuthProvider = (props) => { | |
const { data, error, mutate } = useSWR(`/api/v1/auth/me`) | |
const googleLogIn = async googleData => { |