Skip to content

Instantly share code, notes, and snippets.

View justinledwards's full-sized avatar

Justin Edwards justinledwards

  • Florida Ninth Circuit Courts
  • Florida
View GitHub Profile
@justinledwards
justinledwards / helper.js
Last active April 7, 2023 18:34
Florida Court Case Number Format
export const parseFloridaCourtCaseNumber = (caseNumber) => {
// Regular expression pattern to match Florida court case numbers with optional extra hyphens
const pattern = /^(\d{4})-(\w{2})-(\d{6})(?:-([A-Za-z0-9]+))?(?:-([A-Za-z0-9]+))?$/;
const match = caseNumber.match(pattern);
if (match) {
const [, year, caseTypeAbbrev, sequenceNumber, optionalPart1, optionalPart2] = match;
// Map case type abbreviations to their corresponding strings
const caseTypeMap = {
@justinledwards
justinledwards / snake.mjs
Last active April 3, 2023 18:54
CLI Snake with nodejs chalk and keypress
import chalk from 'chalk';
import keypress from 'keypress';
// npm i chalk keypress
keypress(process.stdin);
const width = process.stdout.columns;
const height = process.stdout.rows - 1;
@justinledwards
justinledwards / dice.html
Last active March 31, 2023 13:37
GPT-4 Openscad Dice
<!-- Is it possible that I can show you a picture? The cube's dimples are actually just spheres, but they're clustered kind of like grapes sticking out of the front face at the upper right of the cube. Is there a better way to make sure they are centered and touching each face? -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Dimpled Dice - Three.js</title>
<style>
body {
@justinledwards
justinledwards / OrbitControls.js
Last active March 29, 2023 21:56
GPT4 3D Snake Game - First few hours of nudging
import {
EventDispatcher,
MOUSE,
Quaternion,
Spherical,
TOUCH,
Vector2,
Vector3
} from 'https://cdnjs.cloudflare.com/ajax/libs/three.js/r128/three.module.js';
@justinledwards
justinledwards / prometheus.yml
Created January 29, 2020 20:33
Prometheus issue
relabel_configs:
- source_labels: [__address__]
target_label: instance
- source_labels: [address, port]
target_label: __address__
replacement: '${1}:${port}'
/* Sweep
by BARRAGAN <http://barraganstudio.com>
This example code is in the public domain.
modified 8 Nov 2013
by Scott Fitzgerald
http://www.arduino.cc/en/Tutorial/Sweep
*/
#include <Servo.h>
require 'discordrb'
bot_token = ENV['BOT_TOKEN']
bot = Discordrb::Bot.new token: bot_token
bot.message(in: 492479830240133161) do |event|
mentions = event.message.role_mentions
mentions.each do |mention|
if mention.name == 'raids'
puts "raids was mentioned"
bot.channel(492480199489749006).send "#{event.author.nickname}: #{event.message} #{Time.now.strftime("%I:%M %p")}"
elsif mention.name == 'exraids'
@justinledwards
justinledwards / randsample.html
Last active November 3, 2017 16:05
Random Sample
<html>
<head>
<title>Random Sample</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
</head>
<body>
<label>Range Start: </label> <input id="range_start" value="1"></input>
<label>Range End: </label> <input id="range_end" value="100"></input>
<label>Sample Size: </label> <input id="sample_size" value="50"></input>
@justinledwards
justinledwards / converter.cr
Created June 9, 2017 13:35
Advice required for first crystal app
# Recorded OTA Conversion App
files = [] of String
Dir.cd "/mnt/MediaArchive/TV-Optimized/"
directory = Dir.glob("**/*")
directory.each do |file|
# TODO, filter files listed to a new array for things that need converting
files << file if /\.ts$/ =~ file
end
@justinledwards
justinledwards / Gemfile
Created September 30, 2016 22:24
Gemfile for sidewalker
source 'https://rubygems.org'
gem 'cinch'
gem 'require_all'
gem 'ruby-hackernews'
gem 'money'
gem 'google_currency'
gem 'ruby-units'
gem 'wolfram-alpha'