I hereby claim:
- I am michaelphipps on github.
- I am michaelphipps (https://keybase.io/michaelphipps) on keybase.
- I have a public key whose fingerprint is FAE5 1CEC F182 EB36 BB3E 4BAD AFC5 0520 8CDF C98D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta content="IE=edge" http-equiv="X-UA-Compatible"> | |
<meta content="width=device-width, initial-scale=1" name="viewport"> | |
<meta content="" name="description"> | |
<meta content="" name="author"> | |
<link href="../../favicon.ico" rel="icon"> | |
<title>JSON API Explorer</title><!-- Latest compiled and minified CSS --> |
If you have web fonts on a subdomain seperate to the domain you are calling them, usual advice is to place the following into the .htaccess file for the subdomain
<IfModule mod_headers.c>
<FilesMatch “.(eot|otf|ttc|ttf|woff|woff2)$”>
Header set Access-Control-Allow-Origin “*”
</FilesMatch>
</IfModule>
The way data is passed in partials in salesforce/handlebars-php isn't the same as it is over at handlebars.js
Inspired by this issue
In this gist, we have a dataset of names that we want to display on a page. We are using a partial to format the display of the names to avoid writing repetitive code.
[
"names"=>[
<?php | |
// $ composer require lcobucci/jwt | |
require __DIR__ . '/vendor/autoload.php'; | |
use Lcobucci\JWT\Configuration; | |
use Lcobucci\JWT\Signer\Key\InMemory; | |
use Lcobucci\JWT\Signer\Hmac\Sha256; |
// Inspired/copied from : https://stackoverflow.com/questions/72151096/how-to-derive-public-key-from-private-key-using-webcryptoapi | |
async function getPublicKeyFromPrivateKey(privateKey) { | |
const jwkPrivate = await crypto.subtle.exportKey("jwk", privateKey); | |
delete jwkPrivate.d; // this trick makes the jwk a public key! | |
jwkPrivate.key_ops = ["verify"]; | |
const publicfromprivate = await crypto.subtle.importKey("jwk", jwkPrivate, {name: "ECDSA", namedCurve: "P-256"}, true, ["verify"]); | |
const publicKey = await crypto.subtle.exportKey('spki', publicfromprivate); | |
return publicKey; | |
} |
const base64url = { | |
encode: (data) => { | |
let base64 = btoa(String.fromCharCode(...data)); | |
return base64.replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_'); | |
}, | |
decode: (base64url) => { | |
let base64 = base64url.replace(/-/g, '+').replace(/_/g, '/'); | |
while (base64.length % 4) base64 += '='; | |
return Uint8Array.from(atob(base64), c => c.charCodeAt(0)); | |
} |