Some advice on setting up 12-factor apps in different environments. The environment variables suggested to set are based on the ones used by envigor (which are themselves based on common precedent).
- Consider your app's environment secret. Most configuration variables (except, maybe, PORT) are imbued with the authentication credentials your app uses to connect to any and all services. Never include a live config in any form with your code. Never place a config somewhere public. Never expose your config.
- Every place you store your config variables is one more place they can be leaked from. Devops valuing paranoia over convenience should keep config in two places: the live server, and the configuration of the related services themselves
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>blot.pw</title> | |
| <link href='//fonts.googleapis.com/css?family=Kavoon|Peralta|Margarine|Chicle|Special+Elite|Ceviche+One|Freckle+Face|Skranji|Sarina' rel='stylesheet' type='text/css'> | |
| <link href='//fonts.googleapis.com/css?family=Gorditas|Sansita+One|Pacifico|Norican|Fontdiner+Swanky|Henny+Penny|Wendy+One' rel='stylesheet' type='text/css'> | |
| <link href='//fonts.googleapis.com/css?family=Rock+Salt|Seaweed+Script|Damion' rel='stylesheet' type='text/css'> | |
| <link href='blot.svg' rel='icon' type='image/svg+xml'> | |
| <style> |
Since this example was written, the connection flow used by caress evolved in several ways (not necessarily in this order):
- POSTs for updating were replaced with PUTs, in closer accordance with the verbs' meanings in HTTP.
- The multiple layers of UUID were reduced to one, with each UUID containing all its associations on the back end.
- The Offer-To and Answer-At locations were consolidated into one location that acts as both depending on the method used (and suggested for use with query string differentiation to get around browser concurrency restrictions).
- Multiple "Answer-To" endpoints for each party reading the offer were consolidated into a single "winner-first" endpoint presented to any inquiring parties (and invalidated after the first response).
- The "Chatphrase-*" headers were replaced with "Location" (for paths expected to be used with GET) and "Reply-Location" (for paths expected to be exclusively POSTed to).
- "Cha
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 convertToEroticSlashfic(example) { | |
| return example.replace(/her/g, 'his') | |
| .replace(/Alice/g, 'Harry') | |
| .replace(/Bob/g, 'Draco'); | |
| } | |
| var convertToEroticSlashfic_codegolf = | |
| function(s){return s.replace(/Alice/g,'Linda')} |
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>Coming soon</title> | |
| <style> | |
| html, body { | |
| height: 100%; | |
| width: 100%; | |
| margin: 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
| function parseUrl(url) { | |
| var urlRegex = /^(?:([A-Za-z]+):)?(\/{0,3})([0-9.\-A-Za-z]+)(?::(\d+))?(?:\/([^?#]*))?(?:\?([^#]*))?(?:#(.*))?$/; | |
| var result = urlRegex.exec(url); | |
| return { | |
| href: result[0], protocol: result[1], slashes: result[2], | |
| hostname: result[3], port: result[4], pathname: result[5], | |
| query: result[6], hash: result[7]}; | |
| } |
- Enable some degree of modularity and interoperability for hashcash library components.
- Specify hashcash patterns for domains beyond email.
- Allow individual components, such as the hashing function, to change without breaking orthogonal components, such as calculation and valuation.
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 iq(ms, f, q) { | |
| q = q || []; | |
| var timer = null; | |
| function drain() { | |
| var p = q.shift(); | |
| if (p) { | |
| f ? f(p) : p(); | |
| } else { | |
| clearInterval(timer); | |
| timer = null; |
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> | |
| <script src="gzip.js"></script> | |
| <script> | |
| function showImg(f) { | |
| var res = document.getElementById('results'); | |
| var e = document.createElement('div'); | |
| res.appendChild(e); | |
| var p = document.createElement('p'); |