Skip to content

Instantly share code, notes, and snippets.

View montchr's full-sized avatar
🎢

chris montgomery montchr

🎢
View GitHub Profile
@fnky
fnky / ANSI.md
Last active May 13, 2025 20:07
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@danyj
danyj / thz_disable_gutenberg.php
Created October 25, 2018 09:15
Disable Gutenberg globally or for specific post types for WordPress 5.0 and UP
<?php
/*
* Disable Gutenberg globally
* use this if you prefer one-liner
* add_filter('use_block_editor_for_post', '__return_false');
*/
function _thz_filter_disable_block_editor(){
return false;
}
add_filter( 'use_block_editor_for_post', '_thz_filter_disable_block_editor' );
@heygrady
heygrady / render-props.md
Last active August 6, 2024 18:50
Avoiding HOC; Favoring render props
@pkazmier
pkazmier / .skhdrc
Last active January 19, 2025 02:23
# Modified from https://github.com/alyssais configuration.
#
# The following configuration heavily leverages modal keymaps to minimize the
# pollution of global keybindings. In addition, the modal keymaps facilitate
# the consistent use of the same keybindings across different modes. For
# example, this configuration uses 'h', 'l', 'j', and 'k' to represent west,
# east, south, and north when: changing focus, warping windows, resizing
# windows, swapping windows, and moving floating windows. Those four keys are
# mapped differently depending on the current mode to provide a consistent user
# experience.
@kingkool68
kingkool68 / basic-class-with-actions-and-filters.php
Created May 4, 2018 18:27
A basic example of a class using actions and filters in WordPress
<?php
class Thing {
/**
* Get an instance of this class
*/
static function get_instance() {
static $instance = null;
if ( null === $instance ) {
$instance = new static();
$instance->setup_actions();
@edolstra
edolstra / nix-lang.md
Last active May 11, 2025 15:28
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
@ladinu
ladinu / encryptedNixos.md
Last active April 24, 2025 10:07
NixOS install with encrypted /boot /root with single password unlock

Requirements

  1. Encrypt everthing including /boot and /root
  2. Enter password once
  3. Support UEFI

Installation media setup

Download NixOS minimal iso and copy to USB stick. For example on Mac OSX

$ diskutil list
$ diskutil unmountDisk /dev/disk1 # Make sure you got right device
@gschoppe
gschoppe / gjs-disable-attachment-pages.php
Last active January 18, 2024 13:49
WordPress plugin to properly disable attachment pages. This is not a redirect or forced 404. Attachment pages will simply not exist, and the slug will remain available for other posts and pages..
<?php if( ! defined( 'ABSPATH' ) ) { die(); }
/**
* Plugin Name: Disable Attachment Pages
* Plugin URI: https://gschoppe.com/wordpress/disable-attachment-pages
* Description: Completely disable attachment pages the right way. No forced redirects or 404s, no reserved slugs.
* Author: Greg Schoppe
* Author URI: https://gschoppe.com/
* Version: 1.0.0
**/
@troyfontaine
troyfontaine / 1-setup.md
Last active May 13, 2025 22:08
Signing your Git Commits on MacOS

Methods of Signing Git Commits on MacOS

Last updated March 13, 2024

This Gist explains how to sign commits using gpg in a step-by-step fashion. Previously, krypt.co was heavily mentioned, but I've only recently learned they were acquired by Akamai and no longer update their previous free products. Those mentions have been removed.

Additionally, 1Password now supports signing Git commits with SSH keys and makes it pretty easy-plus you can easily configure Git Tower to use it for both signing and ssh.

For using a GUI-based GIT tool such as Tower or Github Desktop, follow the steps here for signing your commits with GPG.

Installing on Linode

There are now official docs, so follow those as they'll be up-to-date and easier to follow.

Click here to view the old directions

Installing on Linode