Skip to content

Instantly share code, notes, and snippets.

View codebrainz's full-sized avatar

Matthew Brush codebrainz

View GitHub Profile
@codebrainz
codebrainz / c99.l
Created June 14, 2012 23:49
C99 Lex/Flex & YACC/Bison Grammars
D [0-9]
L [a-zA-Z_]
H [a-fA-F0-9]
E ([Ee][+-]?{D}+)
P ([Pp][+-]?{D}+)
FS (f|F|l|L)
IS ((u|U)|(u|U)?(l|L|ll|LL)|(l|L|ll|LL)(u|U))
%{
#include <stdio.h>
@codebrainz
codebrainz / license.txt
Last active March 6, 2024 00:14
MJPEG Player in JavaScript
Copyright 2015 Matthew Brush
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@codebrainz
codebrainz / gist:1562301
Created January 4, 2012 21:39
Simple bounded queue
/*
* A very basic (and fast) fixed-sized queue data structure.
*
* Author: Matthew Brush <mbrush@codebrainz.ca>
* License: GNU Lesser General Public License, version 2.1
* Edit Date: January 4th, 2011
*/
#include <stdlib.h>
#include "fixedqueue.h"
@codebrainz
codebrainz / add-extensions-gpt.ts
Last active May 19, 2023 20:10
Function generated by ChatGPT to add file extensions to TS imports (untested/unverified).
import * as fs from "fs";
import * as path from "path";
function updateImportsToUseFileExtension(directoryPath: string): void {
const files = fs.readdirSync(directoryPath);
files.forEach((file) => {
const filePath = path.join(directoryPath, file);
// Check if the file is a TypeScript file
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
plugins: ['svelte3', '@typescript-eslint'],
ignorePatterns: ['*.cjs'],
overrides: [
{
files: ['**/*.svelte'],
processor: 'svelte3/svelte3'
@codebrainz
codebrainz / arr-min.js
Created January 4, 2023 22:43
Find the smallest number in an array in JS
function min(arr) {
if (!arr) return NaN;
let min = Number.MAX_VALUE;
for (const element of arr) {
if (element < min) {
min = element;
}
}
return min;
@codebrainz
codebrainz / strrev-copy.js
Created January 4, 2023 21:30
Reversing a string in JS.
let str1 = "hello";
let str2 = "";
for (let i = str1.length - 1; i >= 0; i--) {
str2 += str1[i];
}
console.log(str1, "=>", str2);
diff --git a/src/client/pages/graphics.svelte b/src/client/pages/graphics.svelte
index 427638c..b2af00f 100644
--- a/src/client/pages/graphics.svelte
+++ b/src/client/pages/graphics.svelte
@@ -38,7 +38,7 @@
<!-- Per Bundle; this sets the name -->
<div class="font-bold wrapper-title bg-primary text-primary-content rounded-tl-lg border-neutral-focus border-1 p-1">
<span class="text-xl">{bundle.name}</span>
- <div class="tooltip tooltip-bottom z-20" data-tip="Reload all graphics in this bundle">
+ <div class="tooltip tooltip-bottom" data-tip="Reload all graphics in this bundle">
@codebrainz
codebrainz / main.c
Created October 13, 2012 07:20
ASCII Characters
------------------------------------------------------------------------------
| Dec | Oct | Hex | Binary | Asc | Description |
------------------------------------------------------------------------------
| 0 | 0000 | 00 | 00000000 | NUL | Null char |
| 1 | 0001 | 01 | 00000001 | SOH | Start of Heading |
| 2 | 0002 | 02 | 00000010 | STX | Start of Text |
| 3 | 0003 | 03 | 00000011 | ETX | End of Text |
| 4 | 0004 | 04 | 00000100 | EOT | End of Transmission |
| 5 | 0005 | 05 | 00000101 | ENQ | Enquiry |
| 6 | 0006 | 06 | 00000110 | ACK | Acknowledgment |
@codebrainz
codebrainz / none.conf
Created October 26, 2019 00:16
A colourless Geany colour scheme.
[theme_info]
name=No Theme
description=A colour theme with no language highlighting.
version=0.01
author=
url=
[named_styles]
default=0x000000;0xffffff;false;false