Skip to content

Instantly share code, notes, and snippets.

View justyn-clark's full-sized avatar
🌬️

Justyn Clark justyn-clark

🌬️
View GitHub Profile
@justyn-clark
justyn-clark / go-rust-js-python-cheatsheet.md
Created November 8, 2025 02:20
A quick reference guide comparing Go syntax to JavaScript and Python, focusing on key concepts.
@justyn-clark
justyn-clark / secure_secret_key.bash
Created October 23, 2025 20:02
Generate a Strong Secret Key
# Option 1: Using Python
python -c "import secrets; print(secrets.token_urlsafe(32))"
# Option 2: Using OpenSSL
openssl rand -base64 32
# Option 3: Using Node.js
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
@justyn-clark
justyn-clark / spam_classifier.py
Created March 1, 2025 02:19
end-to-end spam classifier built from scratch. Feel free to experiment with different text preprocessing methods, feature engineering steps, and even other models (like a “from-scratch” logistic regression) to see how results vary.
import csv
import re
import random
from collections import defaultdict
# ----------------
# 1. Loading Data
# ----------------
def load_data(file_path):
"""
// Borrowed & modified from https://github.com/jenseng/abuse-the-platform/blob/main/app/utils/singleton.ts
// Thanks @jenseng!
export const singleton = <Value>(
name: string,
valueFactory: () => Value
): Value => {
const g = global as any;
g.__singletons ??= {};
g.__singletons[name] ??= valueFactory();
@justyn-clark
justyn-clark / remix.action.ts
Created February 24, 2025 03:18
remix.action.ts
import type { ActionFunctionArgs } from "@remix-run/node"; // or cloudflare/deno
export const action = async ({
request,
}: ActionFunctionArgs) => {
switch (request.method) {
case "POST": {
/* handle "POST" */
}
case "PUT": {
import csv
import json
import mailbox
import os
from datetime import datetime
from email.header import decode_header
from email.utils import parsedate_tz, mktime_tz
import pandas as pd
from bs4 import BeautifulSoup
#include <JuceHeader.h>
class LA2ACompressorAudioProcessor : public juce::AudioProcessor
{
public:
LA2ACompressorAudioProcessor()
{
// Initialize parameters
addParameter(inputGainParam = new juce::AudioParameterFloat("InputGain", "Input Gain", -24.0f, 24.0f, 0.0f));
addParameter(outputGainParam = new juce::AudioParameterFloat("OutputGain", "Output Gain", -24.0f, 24.0f, 0.0f));
from pydub import AudioSegment
import os
input_song = "./songs/Wade.aif"
output_path = "./output"
def convert_to_ogg_vorbis(src, out_path):
# Load the audio file
audio = AudioSegment.from_file(src)
@justyn-clark
justyn-clark / NFT.sol
Created March 6, 2022 22:44 — forked from dabit3/NFT.sol
Basic NFT Smart Contract
// contracts/NFT.sol
// SPDX-License-Identifier: MIT OR Apache-2.0
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "hardhat/console.sol";
@justyn-clark
justyn-clark / ecosystem.json
Created January 18, 2022 07:01 — forked from wirwolf/ecosystem.json
pm2 ecosystem.json config example
{
"apps": [
{
/* General */
"name": "my-api", /* (string) application name (default to script filename without extension) */
"script": "index.js", /* (string) script path relative to pm2 start */
"cwd": "/var/www/", /* (string) the directory from which your app will be launched */
"args": "-a 13 -b 12", /* (string) string containing all arguments passed via CLI to script */
"interpreter": "/usr/bin/python", /* (string) interpreter absolute path (default to node) */
"interpreter_args": "--harmony", /* (string) option to pass to the interpreter */