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
https://blog.codepen.io/documentation/features/embedded-pens/ | |
https://blog.codepen.io/documentation/features/embedded-pens/ | |
https://codepen.io/embeds | |
EGBERTO | |
https://www.youtube.com/watch?v=-VAKtWIF0j0 | |
https://www.youtube.com/watch?v=Sn9IsArgGXI |
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
import { useReducer, useCallback } from 'react'; | |
// Usage | |
function App() { | |
const { state, set, undo, redo, clear, canUndo, canRedo } = useHistory({}); | |
return ( | |
<div className="container"> | |
<div className="controls"> | |
<div className="title">👩🎨 Click squares to draw</div> |
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
import { Bearer } from 'permit' | |
import express from 'express' | |
const permit = new Bearer({ | |
basic: 'username', // Also allow a Basic Auth username as a token. | |
query: 'access_token', // Also allow an `?access_token=` query parameter. | |
}) | |
function authenticate(req, res, next) { | |
// Try to find the bearer token in the request. |
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
Creating a Self-Signed Certificate | |
Like enabling HTTPS on a production site, you first need a certificate. For a production site, you request one from a certificate authority like Let’s Encrypt, Comodo, etc. For a local dev environment, we can generate a self-signed certificate on the command line. It used to be as simple as this command: | |
openssl req -new -sha256 -newkey rsa:2048 -nodes \ | |
-keyout dev.deliciousbrains.com.key -x509 -days 365 \ | |
-out dev.deliciousbrains.com.crt | |
Running that command, you get asked a few questions: | |
Country Name (2 letter code) [AU]: | |
State or Province Name (full name) [Some-State]: |
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
<body> | |
<script> | |
window.fbAsyncInit = function () { | |
FB.init({ | |
appId: 'MY_APP_ID', | |
autoLogAppEvents: true, | |
xfbml: true, | |
version: 'v5.0' | |
}); |
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
//https://gist.github.com/huljas/1290219#file-animation-part-1-js | |
var ctx; | |
var canvasObj; | |
var fps = 30; | |
var stars = []; | |
var starCount = 30; | |
var Animation = { | |
init : function(id) { |
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 xmlns:fb="http://www.facebook.com/2008/fbml"> | |
<head> | |
</head> | |
<body> | |
<a href="#" onClick="postToFacebook()">Post to Facebook</a> | |
<script> | |
function postToFacebook() { |
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
<!-- | |
No more annoying messages in console, and no need to add another file to the repository; just include it in the head for a "blank" icon. | |
--> | |
<link href="data:image/x-icon;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQEAYAAABPYyMiAAAABmJLR0T///////8JWPfcAAAACXBIWXMAAABIAAAASABGyWs+AAAAF0lEQVRIx2NgGAWjYBSMglEwCkbBSAcACBAAAeaR9cIAAAAASUVORK5CYII=" rel="icon" type="image/x-icon" /> | |
<!-- ALT: apparently either of the following also suppresses Browser request for favicon.ico --> | |
<link rel="shortcut icon" type="image/x-icon" href="data:image/x-icon;,"> |
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
https://github.com/sindresorhus/open/issues/89 | |
Simple example. the array contains 3 urls; | |
It iterates thru, logs the urls correctly but only the first url is opened. | |
urlsArray.forEach(function(urlLine){ | |
opn(urlLine); //for each url... launch in Browser | |
console.log(urlLine); | |
}); | |
My environment is Windows / default Browser chrome |