Skip to content

Instantly share code, notes, and snippets.

View firestack's full-sized avatar
:accessibility:

Kayla Firestack firestack

:accessibility:
View GitHub Profile
@firestack
firestack / hendricks_formatter.ex
Created December 22, 2023 18:21 — forked from pmarreck/hendricks_formatter.ex
An Elixir formatting module for `mix format` that converts leading spaces to tabs.
defmodule HendricksFormatter do
@moduledoc """
This module is a formatter plugin for Elixir's `mix format` task
that converts leading whitespace to tabs.
It tries to intelligently determine the tab width based on the most common
counts of leading space runs in the file.
It allows additional space characters for minor adjustments that are below the tab width.
OK, why tabs? Why resurrect this age-old nerd debate again?
Very simple: It's an accessibility issue:
https://adamtuttle.codes/blog/2021/tabs-vs-spaces-its-an-accessibility-issue/
@pmarreck
pmarreck / hendricks_formatter.ex
Created July 25, 2023 14:02
An Elixir formatting module for `mix format` that converts leading spaces to tabs.
defmodule HendricksFormatter do
@moduledoc """
This module is a formatter plugin for Elixir's `mix format` task
that converts leading whitespace to tabs.
It tries to intelligently determine the tab width based on the most common
counts of leading space runs in the file.
It allows additional space characters for minor adjustments that are below the tab width.
OK, why tabs? Why resurrect this age-old nerd debate again?
Very simple: It's an accessibility issue:
https://adamtuttle.codes/blog/2021/tabs-vs-spaces-its-an-accessibility-issue/
@MilkyEngineer
MilkyEngineer / Minimal-5.2.uproject
Last active April 11, 2024 19:53
Minimal project descriptor that "Disables Engine Plugins by Default" for Unreal Engine
{
"FileVersion": 3,
"EngineAssociation": "5.2",
"Description": "Minimum viable plugin dependencies for a usable Unreal Engine project",
"DisableEnginePluginsByDefault": true,
"Plugins": [
{
"Name": "PluginBrowser",
"Enabled": true
},
@sinbad
sinbad / StevesEaseMath.cpp
Last active March 31, 2023 11:41
Easing functions from easings.net implemented for Unreal Engine
#include "StevesEaseMath.h"
float UStevesEaseMath::EaseAlpha(float InAlpha, EStevesEaseFunction Func)
{
constexpr float BackC1 = 1.70158f;
constexpr float BackC2 = BackC1 * 1.525f;
constexpr float BackC3 = BackC1 + 1.f;
constexpr float ElasticC4 = UE_TWO_PI / 3.f;
constexpr float ElasticC5 = UE_TWO_PI / 4.5;
@roberth
roberth / minimod.nix
Last active December 29, 2023 07:47
Simple and quick module system alternative + thoughts and tasks
/*
minimod: A stripped down module system
TODO Comparison:
- [ ] Come up with a benchmark "logic" using plain old functions and let bindings
- [ ] Write the benchmark for the module system
- [ ] Write the benchmark for POP?
- [ ] Qualitative comparison of extensibility in the context of composable
Nixpkgs packaging logic
TODO Fine-tuning:
@Madouura
Madouura / bcachefsEncrypted.nix
Created May 31, 2022 07:26
nixpkgs installer.nix bcachefsEncrypted test
bcachefsEncrypted = makeInstallerTest "bcachefs-encrypted" {
extraInstallerConfig = {
boot.supportedFilesystems = [ "bcachefs" ];
environment.systemPackages = with pkgs; [ keyutils ];
};
# We don't want to use the normal way of unlocking bcachefs defined in tasks/filesystems/bcachefs.nix.
# So, override initrd.postDeviceCommands completely and simply unlock with the predefined password.
extraConfig = ''
boot.initrd.postDeviceCommands = lib.mkForce "echo password | bcachefs unlock /dev/vda3";
@vancluever
vancluever / macos-big-sur-ssh-agent-local-no-disable-sip.md
Last active March 9, 2024 21:45
Run SSH Agent w/Modified Options (MacOS Big Sur, No Homebrew, No SIP Modification)

Run SSH Agent w/Modified Options (MacOS Big Sur, No Homebrew, No SIP Modification)

The following will show you how you can modify the startup options of the SSH agent supplied by MacOS in a non-invasive way. This can be useful for doing things like setting a key lifetime, which can then be used with AddKeysToAgent in your ~/.ssh/config to automate the timing out of saved keys. This ensures that your passphrase is re-asked for periodically without having to shutdown, re-log, or having it actually persisted in keychain, the latter being almost as bad as having no passphrase at all, given that simply being logged in is generally enough to then use the key.

This method does not modify the system-installed SSH agent service (com.openssh.ssh-agent), but rather duplicates its functionality into a user-installed launch agent where we can then modify the options. Modifying the system-installed service is becoming increasingly harder to do; SIP generally protects

@tadfisher
tadfisher / build.nix
Last active April 13, 2024 10:31
Simplified Nix integration with Gradle
{ lib
, stdenv
, jdk
, gradle
, mavenRepo
}:
stdenv.mkDerivation {
pname = "built-with-gradle";
version = "0.0";
@ivan
ivan / fix-vscode-server-binaries.nix
Last active May 29, 2022 00:54
Fix vscode server for NixOS
# Based on https://gist.github.com/sonowz/d70b03177c344f4bbbc674de5e5bb937
with import <nixpkgs> {};
let
pname = "fix-vscode-server-binaries";
script = pkgs.writeShellScriptBin pname ''
set -eu -o pipefail
SCRIPT_DIR="$(dirname -- "$(readlink -f -- "$0")")"
@lizthegrey
lizthegrey / attributes.rb
Last active February 24, 2024 14:11
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'