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 November 13, 2024 07:51
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 September 20, 2024 07:01
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
@OleksandrKucherenko
OleksandrKucherenko / DebugViews.java
Last active August 30, 2024 19:20
Android View Hierarchy dump with transformation properties
/** Author: Oleksandr Kucherenko, 2018-present */
package {your.package.name};
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.res.Resources;
import android.graphics.Matrix;
import android.os.Build;
import android.support.annotation.NonNull;
import android.support.v4.util.Pair;
@marrub--
marrub-- / README.md
Last active September 17, 2024 09:48
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 June 13, 2024 02:45
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] = {};
});