Skip to content

Instantly share code, notes, and snippets.

View patrickisgreat's full-sized avatar

Patrick Bennett patrickisgreat

View GitHub Profile
@patrickisgreat
patrickisgreat / trivia-decision-tree.ts
Last active August 27, 2025 22:13
Trivia decision tree
// ---------- Configuration ----------
const FRIEND_WEIGHTS = {
Kim: 0.976,
Ryan: 0.95,
Kristen: 0.95,
Taran: 0.85,
Rachel: 0.75,
Paul: 0.65,
Hillary: 0.45,
Pierce: 0.25,
@patrickisgreat
patrickisgreat / generate_numbers.py
Last active August 9, 2025 18:48
OpenAI TTS Number Generator
#!/usr/bin/env python3
"""
OpenAI TTS Number Generator
Generates WAV files for numbers 1-8000 using OpenAI's Text-to-Speech API
"""
import os
import sys
import time
import zipfile
@patrickisgreat
patrickisgreat / objectdiff.js
Created May 30, 2024 16:08
Deep Object Diffing
function deepDiff(obj1, obj2) {
function changes(obj1, obj2) {
let diff = {};
for (let key in obj1) {
if (obj2.hasOwnProperty(key)) {
if (typeof obj1[key] === 'object' && typeof obj2[key] === 'object') {
let deepChanges = changes(obj1[key], obj2[key]);
if (Object.keys(deepChanges).length > 0) {
diff[key] = deepChanges;
}
function addConditionalPlugins(plugins) {
const config = AppConfig.get();
if (config.responseCacheEnabled) {
plugins.push(
responseCachePlugin({
sessionId: async (requestContext) =>
requestContext.request.http?.headers.get("sc-user") ?? null,
})
);
@charset "utf-8";
/*************************************************
ABOVE THE REST LUXURY CABINS
Custom CSS for Design System | Michael Crowe
*************************************************/
/* TOKENS
==============================================
Color scale */
:root {
<?php
use ExactTarget\ET_Get;
use ExactTarget\ET_Client;
use ExactTarget\ET_Subscriber;
use Illuminate\Http\Request;
class TestController extends Controller
{
/**
<html>
<head>
<title>For Randy</title>
<style type="text/css">
.column {
float: left;
width: 23%;
background: #ccc;
margin: 10px 1%;
@patrickisgreat
patrickisgreat / forRandy.js
Created October 28, 2016 23:41
Resizing stuff to make it more responsiverizedly for RGarcia
//▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼ SCREEN-SIZE LOGIC ▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲▼▲//
$(document).ready(function() {
$window = $(window);
function makeColumnHeightsMatch(container) {
let elementHeights = $(container).map(function() {
return $(this).height();
}).get();
@patrickisgreat
patrickisgreat / PermissionRegistrar.php
Created October 24, 2016 18:27
just to show modern PHP structure
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use Illuminate\Contracts\Auth\Access\Gate;
use Illuminate\Contracts\Cache\Repository;
use Log;
use App\Contracts\Permission;
@patrickisgreat
patrickisgreat / CategoryController.php
Created August 10, 2016 15:29
Example Implementation of Baum/Node in Laravel Spark App
<?php
namespace App\Http\Controllers\API;
use App\Repositories\CategoryRepository;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Permission;
use App\Category;
use Debugbar;