Skip to content

Instantly share code, notes, and snippets.

View fadookie's full-sized avatar
🕹️
😹

Eliot Lash fadookie

🕹️
😹
View GitHub Profile
@fadookie
fadookie / yagpdb-sendMessage.awk
Created August 29, 2023 01:13
YAGPDB Custom Command to send a message to a channel without an embed.
{{/* ACTUAL CODE DONT TOUCH */}}
{{$hasContent := false}} {{$content := false}} {{$contentV := ""}} {{$channel := false}} {{$channelV := .Channel.ID}}
{{$flags := cslice "-channel" "-content"}}
{{- range $k, $v := .CmdArgs -}}
{{- if eq . "-content"}} {{$content = true}} {{else if in $flags .}} {{$content = false}} {{end -}}
{{- if and ($content) (not (eq . "-content"))}} {{$hasContent = true}} {{$contentV = joinStr " " $contentV .}} {{end -}}
{{- if eq . "-channel"}} {{$channel = true}} {{else if in $flags .}} {{$channel = false}} {{end -}}
{{- if and ($channel) (not (eq . "-channel"))}} {{$checkChannel := reReplace `<|>|#` . ""}} {{with getChannelOrThread $checkChannel}} {{$channelV = .ID}} {{end}} {{end -}}
{{- end -}}
@kconner
kconner / macOS Internals.md
Last active April 22, 2024 21:28
macOS Internals

macOS Internals

Understand your Mac and iPhone more deeply by tracing the evolution of Mac OS X from prelease to Swift. John Siracusa delivers the details.

Starting Points

How to use this gist

You've got two main options:

@theodric
theodric / steam-deck-arch-chroot.txt
Last active December 26, 2023 13:16
Setting up an Arch chroot environment on the Steam Deck, then using as NOT a chroot environment
## So you want to use stuff like 'tmux' and 'lolcat' on the Steam Deck, but they haven't been included in the base OS?
# One way to do it is this.
# 1. setup a chroot environment so there is a file structure in which Pacman can download/unpack packages and their dependencies.
# 2. don't use it as a chroot environment; rather, add the various /bin directories inside it to your $PATH, and create an /etc/ld.so.conf.d/deck-local-arch.conf to permit the bins to find the libs they need.
mkdir -p ~/.local/packer
cd ~/.local
#these steps are required, or else the pacstrap will fail with 'marginal trust' errors
pacman -Sy archlinux-keyring
pacman-key --populate archlinux
@bramus
bramus / bookmarklet.md
Last active August 3, 2023 16:56
Mastodon User Page Bookmarklet
@starikcetin
starikcetin / EditorUtils.cs
Last active November 20, 2023 20:16
Unity get Attributes of a specific type on a SerializedProperty
using System;
using System.Reflection;
using UnityEditor;
public static class EditorUtils
{
private const BindingFlags AllBindingFlags = (BindingFlags)(-1);
/// <summary>
/// Returns attributes of type <typeparamref name="TAttribute"/> on <paramref name="serializedProperty"/>.
@fadookie
fadookie / .gitconfig
Last active June 27, 2019 21:26
Hub git aliases
[alias]
browse-tree = !cd -- ${GIT_PREFIX:-.} && hub browse -- tree/"${1-$(git rev-parse --abbrev-ref HEAD)}" # Use argument, or default to HEAD
browse-commit = !cd -- ${GIT_PREFIX:-.} && hub browse -- commit/"${1-$(git rev-parse --short HEAD)}" # Use argument, or default to HEAD
browse-file = !cd -- ${GIT_PREFIX:-.} && hub browse -- blob/"$(git rev-parse --short HEAD)"/$(git ls-files --full-name "$1")
browse-pr = !hub pr list -h "$(git rev-parse --abbrev-ref HEAD)" -f '%U%n' | xargs open
@marrub--
marrub-- / README.md
Last active October 15, 2019 08:33
ZScript Language Documentation
@fadookie
fadookie / Services.cs
Last active January 19, 2018 21:57
Service manager for unity (for accessing single instances of objects globally) and tests
using System;
using System.Collections.Generic;
/// <summary>
/// Simple service manager. Allows global access to a single instance of any class.
/// Copyright (c) 2014-2017 Eliot Lash
/// </summary>
public class Services
{
//Statics
@hyb175
hyb175 / realmMock.js
Last active August 13, 2023 17:41
Realm Mock for jest
// https://github.com/realm/realm-js/issues/370#issuecomment-270849466
export default class Realm {
constructor(params) {
this.schema = {};
this.callbackList = [];
this.data = {};
this.schemaCallbackList = {};
params.schema.forEach((schema) => {
this.data[schema.name] = {};
});
@JPLeBreton
JPLeBreton / wadls.py
Last active March 7, 2021 23:53
wadls - list all map files within a WAD/PK3/ZIP
#!/usr/bin/python
import os, sys, zipfile, tempfile
# wadls (pronounced "waddles", thx joshthenesnerd) - list all maps in a wad/zip/pk3
# requires omgifol module, set path to it here or in env variable
OMG_PATH = os.environ.get('OMG_PATH', None) or '/home/jpl/projects/wadsmoosh'
sys.path.append(OMG_PATH)
import omg