// jQuery
$(document).ready(function() {
// code
})
// Vanilla
document.addEventListener('DOMContentLoaded', function() {
This file contains hidden or 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
| Create a key pair and b64 encode them: | |
| ``` | |
| ssh-keygen -t rsa -b 4096 -m PEM -f ./jwtcookie.key | |
| rsa_priv_key=$(openssl base64 -in jwtcookie.key -A) | |
| rsa_pub_key=$(openssl base64 -in jwtcookie.key.pub -A) | |
| ``` | |
| Put the base-64 encoded keys into a json file like so: | |
| ``` |
This file contains hidden or 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
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="utf-8"> | |
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
| <meta name="viewport" content="width=device-width,initial-scale=1"> | |
| <meta name="theme-color" content="{{ settings.color_button }}"> | |
| <link rel="preconnect" href="https://cdn.shopify.com" crossorigin> | |
| <link rel="preconnect" href="https://fonts.shopifycdn.com" crossorigin> |
This file contains hidden or 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
| snap = () => { | |
| console.log(this.props.vidRef); | |
| const { clientHeight, clientWidth } = this.props | |
| const ctx = this.canvas.current.getContext('2d') | |
| ctx.drawImage(this.props.vidRef.ref, 0, 0, 640, 480) | |
| ctx.font = '20px Arial' | |
| ctx.fillText( | |
| `${this.props.vidRef.currentTime}s / ${this.player.current.duration}s`, | |
| 5, | |
| 20 |
This file contains hidden or 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
| // Setup canvas .. | |
| var canvas = document.getElementById('main-canvas'), | |
| ctx = canvas.getContext('2d'); | |
| // setup lines styles .. | |
| ctx.strokeStyle = "#DDD"; | |
| ctx.lineWidth = 2; | |
| // some variables we'll need .. | |
| var drawing = false; |