Skip to content

Instantly share code, notes, and snippets.

View DusterTheFirst's full-sized avatar
🚀

Zachary Kohnen DusterTheFirst

🚀
View GitHub Profile
@DusterTheFirst
DusterTheFirst / re-sign-commits.md
Last active June 22, 2021 00:42
Retroactively sign commits
git pull
git status
git log
git rebase -i --committer-date-is-author-date --root

replace all pick with reword. Skip through all commits

git status
@DusterTheFirst
DusterTheFirst / .clang-format
Last active March 4, 2021 17:39
Calculating rolling averages in C
Standard: Latest
BasedOnStyle: LLVM
IndentWidth: 4
ColumnLimit: 0
AccessModifierOffset: -2
NamespaceIndentation: All
BreakBeforeBraces: Attach
IndentCaseLabels: true
FixNamespaceComments: false
AlignOperands: true
@DusterTheFirst
DusterTheFirst / .gitignore
Last active December 2, 2020 14:43
ECS Notes Orange
*.rkt
/*!
* Copyright (C) 2018-2020 Zachary Kohnen (DusterTheFirst)
*/
/** A class to represent a color */
export class Color {
/** The red component for the color */
public r: number;
/** The green component for the color */
public g: number;
@DusterTheFirst
DusterTheFirst / createLocalProxies.sh
Last active June 15, 2019 15:59
Create VHOSTS for lighttpd from a simple json file using only `include_shell "/usr/share/lighttpd/createLocalProxies.sh"`. So easy, elliot can use it.
#!/bin/sh
# Place in /usr/share/lighttpd/
FILENAME="/etc/lighttpd/localProxies.json"
cat $FILENAME\
| jq 'to_entries[] | .key as $host | .value | to_entries[] | {host: "\(.key).\($
| jq -r '
"else $HTTP[\"host\"] == \"\(.host)\" {
@DusterTheFirst
DusterTheFirst / index.ts
Last active April 30, 2019 09:09
A scraped list of HTTP status codes exported as a typescript enum for your pleasure
/*!
* Copyright (C) 2019 Zachary Kohnen
*
* 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:
*
@DusterTheFirst
DusterTheFirst / yarn-error.log
Created April 25, 2019 20:46
Yarn-Pack error log
Arguments:
/Users/DusterTheFirst/.nvm/versions/node/v12.0.0/bin/node /usr/local/lib/node_modules/yarn/lib/cli.js pack
PATH:
/usr/local/opt/curl/bin:/Users/DusterTheFirst/.nvm/versions/node/v12.0.0/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/DusterTheFirst/.cargo/bin:/Users/DusterTheFirst/.deno/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/apache-maven-3.6.0/bin:/usr/local/MacGPG2/bin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Wireshark.app/Contents/MacOS:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin:/usr/local/opt/curl/bin:/Users/DusterTheFirst/.nvm/versions/node/v12.0.0/bin:/usr/local/sbin:/opt/local/bin:/opt/local/sbin:/Users/DusterTheFirst/.cargo/bin:/Users/DusterTheFirst/.deno/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/Library/Frameworks/Python.framework/Versions/2.7
@DusterTheFirst
DusterTheFirst / shop.json
Created April 4, 2019 03:54
GUIShopMinus sample shop.json autogenerated file
/*
* DO NOT EDIT THIS FILE
*
* This file was generated using https://whsmc.github.io/GUIShopMinus
* and modifying this file may lead to data corruption or
* instability in the plugin
*/
{
"name": "&4SHOPNAMEHERE",
@DusterTheFirst
DusterTheFirst / autoform.ts
Last active February 7, 2019 12:57
HTML form to JSON form for auto submission
/** An object with string keys and values */
type StringOBJ = { [x: string]: string };
/** Generate a JSON representation of a form */
function generateJSONForm(form: HTMLFormElement): StringOBJ {
// Create empty object
let object = {} as StringOBJ;
// Loop through children
for (let elem of form.children) {
@DusterTheFirst
DusterTheFirst / paginator.ts
Last active August 12, 2019 18:35
Discord.js Paginator (MIT licensed)
import { User, TextChannel, Message, ReactionCollector } from "discord.js";
class Paginator {
/**
* Current page
*/
current: number;
/**
* Total pages
*/