Skip to content

Instantly share code, notes, and snippets.

View CodeZombie's full-sized avatar
🌵

Jeremy Clark CodeZombie

🌵
View GitHub Profile
@CodeZombie
CodeZombie / ratelimiter_demo.dart
Created November 12, 2022 22:16
Dart Rate Limiter
class RateLimiter {
late int waitTimeMilliseconds = 2500;
DateTime lastActionTime = DateTime.now();
Future<Function> doAction(Function f) async {
while (true) {
if (DateTime.now().isAfter(lastActionTime.add(Duration(milliseconds: waitTimeMilliseconds)))) {
break;
} else {
await Future.delayed(const Duration(milliseconds: 100));
version: '2.0'
services:
db:
image: mariadb:10.5
container_name: seafile-mysql
environment:
- MYSQL_ROOT_PASSWORD=db_dev # Requested, set the root's password of MySQL service.
- MYSQL_LOG_CONSOLE=true
volumes:
- /mnt/twotera/seafile-mysql/db:/var/lib/mysql # Requested, specifies the path to MySQL data persistent store.
@CodeZombie
CodeZombie / _etc_dnsmasq.conf
Created September 12, 2022 01:49
DnsMasq & Nginx
port=53
domain-needed
bogus-priv
strict-order
address=/ham/127.0.0.1
interface=eno1
listen-address=127.0.0.1
expand-hosts
domain=box.ham
@CodeZombie
CodeZombie / main.dart
Last active January 16, 2022 22:58
Dart arbitrary caching middleware
var CacheDatabase = Map();
//An arbitrary function which returns a String
String sexNumberAsString() {
return "69";
}
//Another arbitrary function which takes in arguments and returns a different type.
int add(int a, int b) {
@CodeZombie
CodeZombie / ulauncher-service.service
Last active December 31, 2021 22:55
A systemd user service
# How To Use:
# ~/.config/systemd/user/ulauncher-service.service
# systemctl --user daemon-reload
# systemctl --user enable ulauncher-service.service
# systemctl --user start ulauncher-service.service
[Unit]
Description=Starts uLauncher and keeps it alive
[Service]
@CodeZombie
CodeZombie / irssi.desktop
Created December 31, 2021 08:54
irssi.desktop
[Desktop Entry]
Name=Irssi
Comment=Chat with freaks
GenericName=IRC Client
X-GNOME-FullName=Irssi IRC Client
Exec=xfce4-terminal -T="Irssi" --command="irssi" --icon=irc-channel-active --hide-scrollbar --hide-menubar %u
Terminal=true
Type=Application
Icon=irc-channel-active
Categories=Network;
@CodeZombie
CodeZombie / ConWin.cpp
Created December 11, 2021 23:44
The Console Windowing System
/***************************************
* CONWIN: The CONsole WINdowing system
*
* Useful for making basic visual interfaces
* within limited console windows.
*
* Created March 2019, Jeremy Clark & Matt Marini
* ****************************************/
namespace ConWin {
@CodeZombie
CodeZombie / run_simulation.sh
Last active October 31, 2021 16:54
shell script which takes in parameters, runs a simulation, creates data trace files and generates graphs.
#!/bin/bash
# Parse flags.
for ARGUMENT in "$@"
do
KEY=$(echo $ARGUMENT | cut -f1 -d=)
VALUE=$(echo $ARGUMENT | cut -f2 -d=)
case "$KEY" in
ENDNODES) ENDNODES=${VALUE} ;;
GENETIC) GENETIC=${VALUE} ;;
@CodeZombie
CodeZombie / gegl_windows.md
Last active July 14, 2021 21:08
How to compile GEGL on windows.

How To Install GEGL On Windows

You want to compile GEGL on windows? Good for you. Here's how to do it.

First, install MSYS2. Open up the MSYS2 MinGW 64-Bit terminal

Let's install some necessary build tools:

pacman -S git
<?xml version="1.0" encoding="utf-8"?>
<CymaticCore xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Seed.Cymatic.Core">
<nodes>
<BaseSignalNode i:type="ExternalNode">
<ID>7</ID>
<Enabled>false</Enabled>
<signalInputData />
<signalOutputData>
<SignalOutputData>
<outputName>Output</outputName>