You should install Electron Fiddle.
Please clone and install the dependencies for the following respositories:
You should install Electron Fiddle.
Please clone and install the dependencies for the following respositories:
The following are examples of the four types rate limiters discussed in the accompanying blog post. In the examples below I've used pseudocode-like Ruby, so if you're unfamiliar with Ruby you should be able to easily translate this approach to other languages. Complete examples in Ruby are also provided later in this gist.
In most cases you'll want all these examples to be classes, but I've used simple functions here to keep the code samples brief.
This uses a basic token bucket algorithm and relies on the fact that Redis scripts execute atomically. No other operations can run between fetching the count and writing the new count.
function manageRequests(acceptAll, ignoreAll, acceptCount){ | |
let invitationsList = document.getElementsByClassName('mn-invitation-list')[0] | |
let requests = invitationsList.querySelectorAll('li') | |
let lengthOfRequests = requests.length | |
function alertUser(fnCall, count){ | |
alert(`Hey User, you are about to ${fnCall} - ${count} connection requests`) | |
} | |
function handleRequests(num, count) { | |
for(let i=0; i<count; i++) { | |
requests[i].querySelector('.invitation-card__action-container').querySelectorAll('button')[num].click() |
Free to read online: exploringjs.com/impatient-js/
esm
package.String.prototype.replaceAll()
Promise.any()
_
) as separators in number literals and bigint literals:root { | |
--violation-color: red; /* used for clear issues */ | |
--warning-color: orange; /* used for potential issues we should look into */ | |
} | |
/* IMAGES */ | |
/* | |
* Lazy-Loaded Images Check | |
* ==== |
#!/usr/bin/env jq -rMf | |
# Extract other metrics from the run data | |
# Headers for resulting CSV | |
["TTFB", "First Contentful Paint", "Start Render", "DOM Complete" , "Fully Loaded"], | |
# drill down into the runs data | |
( | |
.data.runs | |
# convert the run data into an object and drill down into the run request data |
#!/usr/bin/env bash | |
set -eou pipefail | |
profile=$1 | |
frameRate=${2:-10} | |
timeline='timeline.json' | |
cat $profile \ | |
| jq '.[] | select(.args.snapshot | . and (type == "string") and contains("/9j"))' \ | |
| jq -s . \ | |
> $timeline |
Commands | |
------------ | |
1. Build Docker Image | |
docker build -t test . | |
2. Run container /w image | |
docker run -d --publish 8888:5000 test | |
3. Login to ECR | |
aws ecr get-login-password --region REGIONHERE!!!! | docker login --username AWS --password-stdin ACCOUNTIDHERE!!!!.dkr.ecr.REGIONHERE!!!.amazonaws.com |
## Setting up the middleware for redirect to https ## | |
http: | |
middlewares: | |
redirect: | |
redirectScheme: | |
scheme: https |
version: "3.3" | |
services: | |
################################################ | |
#### Traefik Proxy Setup ##### | |
############################################### | |
traefik: | |
image: traefik:v2.0 | |
restart: always |