Skip to content

Instantly share code, notes, and snippets.

View boxpositron's full-sized avatar
🎯
Focusing

David Ibia boxpositron

🎯
Focusing
View GitHub Profile
from typing import Optional
def generate_bit_binaries(size: Optional[int] = 8) -> None:
namespace = 2 ** size
for i in range(namespace): # 256 because 2^8 = 256
# Format the number as a binary with leading zeros
binary_format = f"{i:08b}"
@boxpositron
boxpositron / README.md
Created June 8, 2023 13:32
Partial Interfaces for Component in Typescript

Partial Interfaces Example

type NestedProperty = {
  foo: string;
  bar: string;
};

interface ComponentOptions {
@boxpositron
boxpositron / segment-model.md
Last active October 28, 2022 12:47
Tracksend Segments

Segment Model

Proposed segment model design

Requirements

Structure

Proposed mongoose Schema and associated interfaces.

@boxpositron
boxpositron / rename_js_files.sh
Created July 4, 2022 19:35 — forked from afternoon/rename_js_files.sh
Rename .js files to .ts
find app/src -name "*.js" -exec sh -c 'mv "$0" "${0%.js}.ts"' {} \;
@boxpositron
boxpositron / processor.ts
Last active April 11, 2022 10:00
ComposeMessage Tracksend
‎‎​
@boxpositron
boxpositron / map.json
Created October 22, 2021 10:38 — forked from drain/map.json
{
"PX1": "no_script",
"PX2": "js_bootstrap",
"PX3": "domready",
"PX4": "fingerprint",
"PX6": "nav_timing",
"PX7": "incognito",
"PX8": "score_session",
"PX9": "score_impression",
"PX10": "ui_interaction",
const recursionExample = () =>
new Promise((resolve, reject) => {
const maxCycles = 10
let cycle = 0
const run = () => {
try {
if (cycle > maxCycles) {
throw new MaxTriesError(`Max of ${maxCycles} reached`)
}
sudo yum update -y
sudo yum install epel-release -y
sudo yum install git -y
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
curl -sL https://rpm.nodesource.com/setup_10.x | sudo bash -

xServer API Documentation

Base URL

https://xserver.boxmarshall.com/api/v2/authorize

Validation Endpoint

Validation will fail if license key is not activated

@boxpositron
boxpositron / ec2-init.sh
Last active July 21, 2020 11:27
EC2 Setup Base - NGINX
sudo yum update -y
sudo amazon-linux-extras install epel -y
sudo yum install git -y
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm