$ openssl genrsa -out private.key 4096
openssl req -new -sha256 \
# CodePipeline by default runs an execution whenever any change is detected in the configured source repository | |
# We can use a CodePipeline Webhook resource to filter such executions. | |
# | |
# This is a snippet that would be part of a CloudFormation template containing | |
# a CodePipeline resource (AWS::CodePipeline::Pipeline), named CodePipeline in this case, and | |
# assumes the GutHub OAuth token is available in the parameter GitHubOAuthToken. | |
# Typically a CodePipeline Webhook only contains the $.ref filter to check for | |
# the desired branch. | |
# However we can add up to 4 more filters, each of which can query the incoming webhook payload from Github. | |
# Such payloads are of the form: |
server { | |
listen 80; | |
listen 443 default_server ssl; | |
ssl on; | |
ssl_certificate /etc/ssl/certs/myssl.crt; | |
ssl_certificate_key /etc/ssl/private/myssl.key; | |
server_name *.example.com; | |
root /var/www/vhosts/website; |
import { action, computed, observable, reaction, when } from 'mobx'; | |
export default class RateLimiter { | |
@observable forgiveness; | |
@observable limit; | |
@observable offenses = 0; | |
@observable queue = []; | |
@observable wait; | |
@computed get compoundedPenalty() { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>BrowserSync Proxy Server</title> | |
</head> | |
<body> | |
<h1>BrowserSync Proxy Server</h1> | |
<ul> | |
<li><a href="/api/" data-bare-link="true"><code>/api/</code></a> This page.</li> |
/** | |
* Determine if event target is a descendant of a DOM node | |
* @param {Object} event - The event object | |
* @param {Element} parent - The DOM node to check if event target is equal to or a descendant of | |
* @return {Boolean} | |
*/ | |
function targetIsDescendant(event, parent) { | |
var node = event.target || null; | |
while (node !== null) { | |
if (node === parent) return true; |
import { flatten, keys, startCase, uniq } from 'lodash'; | |
const json2csv = (rows = []) => { | |
const columns = parseCSVColumns(rows); | |
return [parseCSVHeaders(columns), ...rows.map(row => parseCSVRow(row, columns))].join('\n'); | |
}; | |
const escapeCSVString = (str = '') => { | |
const value = str ? JSON.parse(JSON.stringify(str)) : ''; |
.trippy { | |
animation-name: animate-trippy; | |
animation-duration: 1s; | |
animation-timing-function: ease-in-out; | |
animation-iteration-count: infinite; | |
animation-direction: alternate | |
} | |
@keyframes animate-trippy { | |
0% { |
// Usage: | |
// var el = docuemnt.getElementById('scrollable-div'); | |
// el.addEventListener('wheel', preventWindowScroll, false); | |
function preventWindowScroll(e) { | |
var direction = e.deltaY < 0 ? 'up' : 'down'; | |
var el = e.currentTarget; | |
var atTop = el.scrollTop <= 0; | |
var atBottom = (el.scrollHeight - (el.clientHeight + el.scrollTop) <= 0); | |
if ((direction === 'up' && atTop) || (direction === 'down' && atBottom)) { | |
e.preventDefault(); |