This file contains 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
// KSUIDs should be 20 bytes: 4 for the timestamp and 16 for the payload | |
const TIMESTAMP_BYTES = 4; | |
const PAYLOAD_BYTES = 16; | |
const TOTAL_BYTES = TIMESTAMP_BYTES + PAYLOAD_BYTES; | |
function getCurrentTimestamp() { | |
// KSUID timestamps have a custom epoch that starts in 14e8 | |
const CUSTOM_EPOCH_DIFF = 1_400_000_000; | |
const timestamp = Math.floor(Date.now() / 1000) - CUSTOM_EPOCH_DIFF; |
This file contains 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 dynamically without SSR, as this is expected to be rendered clientside only | |
// e.g. const ModalPortal = dynamic(() => import('~/shared/components/ModalPortal'), { ssr: false }); | |
// | |
// Expects an empty div with id of `modal-portal-root` somewhere in the DOM | |
import React, { useRef, useEffect } from 'react'; | |
import { createPortal } from 'react-dom'; | |
function ModalPortal({ children }) { | |
const $modalPortalRoot = useRef(); |
This file contains 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
export default function debounce (fn, delay) { | |
let timeoutID = null; | |
return function (...args) { | |
clearTimeout(timeoutID); | |
timeoutID = setTimeout(() => { | |
fn.call(this, ...args); | |
}, delay); | |
}; | |
}; |
This file contains 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 React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
class ReCAPTCHA extends Component { | |
static propTypes = { | |
sitekey: PropTypes.string.isRequired, | |
onVerify: PropTypes.func, | |
}; | |
static defaultProps = { |
This file contains 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 React, { Component } from 'react'; | |
import classnames from 'classnames'; | |
const ALT = 18; | |
class MacOSWindowControls extends Component { | |
state = { | |
altKeyDown: false, | |
blurred: false, | |
fullscreen: false, |
This file contains 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 React, { Component } from 'react'; | |
import _ from 'lodash'; | |
import classnames from 'classnames'; | |
import { remote } from 'electron'; | |
class WindowsWindowControls extends Component { | |
state = { | |
fullscreen: false, | |
blur: false, | |
}; |
This file contains 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
{ | |
"name": "this-web-scale", | |
"version": "0.0.1", | |
"scripts": { | |
"dev": "node server.js", | |
"build": "NODE_ENV=production next build", | |
"start": "NODE_ENV=production node server.js", | |
"dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker", | |
"deploy": "eb use this-web-scale-production && eb deploy --label v$npm_package_version --verbose", | |
"build:docker": "docker build -t $npm_package_config_docker_image:$npm_package_version -t $npm_package_config_docker_image:latest .", |
This file contains 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
branch-defaults: | |
develop: | |
environment: this-web-scale-production | |
deploy: | |
artifact: Dockerrun.aws.json | |
environment-defaults: | |
this-web-scale-production: | |
branch: null | |
repository: null | |
global: |
This file contains 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
{ | |
"name": "this-web-scale", | |
"version": "x.x.x", | |
"scripts": { | |
"dev": "node server.js", | |
"build": "NODE_ENV=production next build", | |
"start": "NODE_ENV=production node server.js", | |
"dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker", | |
"deploy": "npm run deploy:staging", | |
"deploy:staging": "eb use token-staging && eb deploy --label v$npm_package_version --verbose", |
This file contains 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
{ | |
"name": "this-web-scale", | |
"version": "x.x.x", | |
"scripts": { | |
"dev": "node server.js", | |
"build": "NODE_ENV=production next build", | |
"start": "NODE_ENV=production node server.js", | |
"dockerize": "npm run build:docker && npm run tag:docker && npm run push:docker && npm run tag-latest:docker && npm run push-latest:docker", | |
"deploy": "npm run deploy:staging", | |
"deploy:staging": "eb use token-staging && eb deploy --label v$npm_package_version --verbose", |
NewerOlder