- Docker: v18.06.0+
- Docker Compose: v1.22.0+
- Ports 80 and 443 should be open
- Hardware:
- Minimum configuration: 4 GB RAM, 2 CPU, 8 GB disk space
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
// On first access looks up a search param: `?token=...` | |
// If the token is valid, saves it in cookies so that | |
// subsequent requests don't need the search param. | |
import type { Config, Context } from "@netlify/edge-functions"; | |
// Ideally look up from the environment | |
const EXPECTED_TOKEN = "very-secret"; | |
const TOKEN_COOKIE_NAME = "my-token"; | |
const TOKEN_HEADER_NAME = "x-my-token"; |
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
// MIT Licensed | |
// Author: jwilson8767 | |
/** | |
* Waits for an element satisfying selector to exist, then resolves promise with the element. | |
* Useful for resolving race conditions. | |
* | |
* @param selector | |
* @returns {Promise} | |
*/ |
- Code for generating the user_hash value for Intercom's Identity verfication (Note: Identity verification was prevoiusly called Secure Mode)
- Based on http://www.jokecamp.com/blog/examples-of-creating-base64-hashes-using-hmac-sha256-in-different-languages/#ruby
- When creating this for mobile, the final output needs to be in lowercase (the web version accepts both upper and lower case)
- So Javascript code below should only be used for testing unless modified and used to run on a server
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
/** | |
* Fix for vw, vh, vmin, vmax on iOS 7. | |
* http://caniuse.com/#feat=viewport-units | |
* | |
* This fix works by replacing viewport units with px values on known screen sizes. | |
* | |
* iPhone 6 and 6 Plus cannot run iOS 7, so are not targeted by this fix. | |
* Target devices running iOS 8+ will incidentally execute the media query, | |
* but this will still produce the expected result; so this is not a problem. |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on macOS Sierra, but they have been known to work in El Capitan, Yosemite, Mavericks, and Mountain Lion.
NOTE: You may substitute the edit
command for nano
, vim
, or whatever the editor of your choice is. Personally, I forward the edit
command to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
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
//CUSTOM SELECT - prevent double wrap incase this script is include in multiple locations... | |
$('select').each(function(){ | |
var t = $(this); | |
if( !t.parent().hasClass('customSelect') ){ | |
t.wrap('<div class="customSelect" />').before('<div class="displayCopy empty"></div>'); | |
} | |
}).on('change fauxChange', function(){ | |
var t = $(this); | |
t.siblings('.displayCopy').text( t.find('option:selected').text() ); | |
//toggle "empty" class |
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
function binaryblob(){ | |
var byteString = atob(document.querySelector("canvas").toDataURL().replace(/^data:image\/(png|jpg);base64,/, "")); | |
var ia = new Uint8Array(ab); | |
for (var i = 0; i < byteString.length; i++) { | |
ia[i] = byteString.charCodeAt(i); | |
} | |
var dataView = new DataView(ab); | |
var blob = new Blob([dataView], {type: "image/png"}); | |
var DOMURL = self.URL || self.webkitURL || self; | |
var newurl = DOMURL.createObjectURL(blob); |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title></title> | |
<style> | |
.is-active { | |
color: red; | |
} | |
</style> |
NewerOlder