Skip to content

Instantly share code, notes, and snippets.

View LoganDark's full-sized avatar

LoganDark LoganDark

View GitHub Profile
import discord
paired = {
'channel that will trigger the bot': 'channel the bot will copy messages to',
'you know the drill': 'i can do this all day'
}
keyword_data = {
'channel that will trigger the bot': ['keyword', 'copybot', ['both of these', 'must be in the same message']]
}
@LoganDark
LoganDark / install_libs.sh
Last active July 21, 2017 03:36
A small script I created to install missing libraries for commands installed via slackpkg.
bin=
if [ -z "$1" ]; then
read -p 'Please enter the name of a command with missing libraries: ' bin
else
bin="$1"
fi
printf '
'
@LoganDark
LoganDark / crash-percent.sh
Last active April 1, 2020 03:18
A script that tells you how close most of macOS is to becoming unresponsive. I put this in my PATH.
#!/bin/bash
# macOS Mojave build >18A326g has a nasty issue.
#
# Basically, loginwindow likes threads. It's so passionate about threads that
# it will continue to collect threads endlessly. Now, the problem with such a
# process collecting so many threads is that, as the owner of all processes
# running under your account, if the process crashes, say goodbye to most of
# macOS.
#
# Well, this is exactly what happens. loginwindow freezes at 4096 threads and
@LoganDark
LoganDark / crash-percent.js
Last active December 23, 2019 10:18
A notifier that warns you when macOS is about to crash.
// This is JXA, i.e. you can't run it with plain `node`. Use `osascript` or the Script Editor.
// I recommend exporting it to an `.app` and running it at login if you have my same issue.
// Requires this script: https://gist.github.com/LoganDark/b8c74e14c06b77e6f16d4492c5bda928
// CONFIGURE crashPercentScript in run() to point to your script. Make sure to chmod +x to make
// it executable.
function getCrashPercent(app, script) {
return +/\d+/.exec(app.doShellScript(script).split('\r')[0])[0]
}
@LoganDark
LoganDark / kexts.sh
Last active September 13, 2018 16:21
#!/bin/bash
# Print a list of third-party kexts your system includes. Output is made for Markdown.
kextstat | grep -v com.apple | egrep -o '\S+ \S+ \S+ <(\d+\s+)*\d>$' | egrep -o '^\S+' | tr '\n' ',' | sed 's/,/`, `/g' | sed 's/`, `$//g' | sed 's/^/`/' | sed 's/$/`/'

Keybase proof

I hereby claim:

  • I am logandark on github.
  • I am logandark (https://keybase.io/logandark) on keybase.
  • I have a public key ASDjdjq5DH55DsrKKK-0hZThtdZwrAzIfbqCJIXoFBmCjgo

To claim this, I am signing this object:

@LoganDark
LoganDark / LanguageHack.kt
Last active May 9, 2020 10:59
Allows the Minecraft dedicated server to see localized (TranslatableText) messages. Activate in your ModInitializer only on the server side
package net.logandark.languagehack
import com.google.gson.Gson
import com.google.gson.JsonObject
import net.fabricmc.loader.api.FabricLoader
import net.logandark.languagehack.mixin.MixinLanguage
import net.minecraft.util.JsonHelper
import net.minecraft.util.Language
import org.apache.logging.log4j.core.util.Closer
import java.io.InputStreamReader
@LoganDark
LoganDark / atom-watcher.d.ts
Created September 27, 2021 08:37
Typings for @atom/watcher
declare module '@atom/watcher' {
import {Disposable} from 'event-kit'
export const DISABLE: unique symbol
export const STDOUT: unique symbol
export const STDERR: unique symbol
// May be one of:
//
// - A `string` specifying a path to log to a file. Be careful that you
import {DependencyList, useCallback, useDebugValue, useRef} from 'react'
import useForceUpdate from 'use-force-update'
/*! Copyright © 2021 LoganDark
*
* 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
@LoganDark
LoganDark / nanorc.nanorc
Last active December 20, 2021 03:37
Very colorful and advanced nanorc syntax file
# Created by LoganDark for Nano 6.0
syntax "nanorc" "(\.?|^|/)nanorc$"
comment "#"
#icolor red,white "^\s*i?color.*$"
icolor red "^\s*\S+.*$"
# set directive