Skip to content

Instantly share code, notes, and snippets.

View joshuabradley012's full-sized avatar

Josh Bradley joshuabradley012

View GitHub Profile
<script id="__NEXT_DATA__" type="application/json">{
"props": {
"pageProps": {
"page": {
"__typename": "Page",
"title": "Library",
"databaseId": 2,
"seo": {
"__typename": "PostTypeSEO",
"title": "Construction Resource Library | Procore",
@joshuabradley012
joshuabradley012 / debug-fields.js
Last active November 16, 2022 18:19
Debug Fields Script Reference
/**
* Debug Fields
*
* Standard debug fields used with Google Tag Manager and Google Analytics.
* This can be implemented in your codebase (recommended) or in Google Tag
* Manager if access is limited.
*/
/**
# Executed 1000 requests per second for 1 minute from ids 9000000-9999999
##
# Before caching
##
# loader.io config
Test type: Clients per second
Clients: 1000
Duration: 1 min
# Executed 1000 requests per second for 10 seconds using 1000000 different IDs
# Artillery config
config:
target: 'http://localhost:6002'
phases:
- duration: 10
arrivalRate: 1000
payload:
path: "ids.csv"
// GET http://localhost:6060/api/workspace-description/1
{
"_id": "600c6ced99960c647ffae467",
"id": 1,
"name": "Coloring book schlitz paleo selvage direct trade",
"url": "coloring-book-schlitz-paleo-selvage-direct-trade",
"descriptionHeadline": "Wolf thundercats taxidermy authentic tumeric prism put",
"description": "Coloring book schlitz paleo selvage direct trade cred pok pok copper mug slow-carb YOLO kombucha jianbing taxidermy chicharrones subway tile. Wolf thundercats taxidermy, authentic tumeric prism put a bird on it fashion axe woke hashtag. Hell of farm-to-table everyday carry waistcoat ethical pour-over. Lomo cred iceland yr skateboard. Art party keffiyeh health goth plaid adaptogen pickled. Selvage vaporware fingerstache yr pop-up, bicycle rights neutra. Authentic locavore readymade YOLO four loko, XOXO butcher whatever shaman.",
"__v": 0
@joshuabradley012
joshuabradley012 / Object collisions with canvas
Last active July 22, 2024 08:17
An example of 2D collisions using JavaScript Canvas
class State {
constructor(display, actors) {
this.display = display;
this.actors = actors;
}
update(time) {
/**
* provide an update ID to let actors update other actors only once
(def _null (x)
(is x nil))
(def _and (x y)
(if (is x t) (is y t) t nil))
(def _not (x)
(if (is x nil) t))
(def _caar (x)