Skip to content

Instantly share code, notes, and snippets.

@the0neWhoKnocks
the0neWhoKnocks / Set Up Signed Commits for GitHub.md
Last active April 13, 2024 02:01
Set Up Signed Commits for GitHub

Set Up Signed Commits for GitHub

I opted to use an SSH key for signing, mainly because I already had one set up for cloning/pulling/pushing. It also seemed the easiest setup compared to the GPG stuff.


  1. Run
    git config --global gpg.format ssh
    git config --global user.signingkey ~/.ssh/<KEY_NAME>.pub
@the0neWhoKnocks
the0neWhoKnocks / How to Convert Author Info in Multiple GitHub Repos.md
Last active April 12, 2024 05:16
How to convert author info in multiple GitHub repos

How to Convert Author Info in Multiple GitHub Repos

This came about because I saw how easy it was to view my info (name and email) by just adding .patch at the end of a commit URL on GitHub.


  1. Go to https://github.com/settings/emails to view your current mappings for emails. For each email there'll be a Not visible in emails section. Take note of the sentence that calls out We will instead use followed by an email. That users.noreply.github.com email is the one that's going to be used going forward.
    • Also make sure these items are checked

[X] Keep my email addresses private

Unix Command Equivalents on Windows

Unix Command Command PowerShell What It Does
which <EXECUTABLE>
where <EXECUTABLE>
(Get-Command -ErrorAction SilentlyContinue -Name <EXECUTABLE>).Path
Outputs a path to an executable if it exists, or a blank string. Usually used to help determine if something is installed/available to use.
@the0neWhoKnocks
the0neWhoKnocks / Windows Settings.md
Last active April 11, 2023 04:30
Windows settings

Windows Settings


Bluetooth

How to remove device that can't be removed from the Bluetooth window?
Sometimes you can't pair a new device (like a new game controller) because there's a conflict with an old device. When you try to remove the device it may keep reporting 'Failed to remove'. If you go into Device Manager > View > Show Hidden Devices, and then expand the Bluetooth section you may see grayed out duplicate entries for your device. Try removing those and see if the troublesome device disappears from the Bluetooth window.

How to set up an XBox controller
I got a USB to Bluetooth dongle, and for an older controller I was able to just plug it in, go to Bluetooth > Add Device > Everything else, put the controller into pairing mode and it would just show up and pair.

@the0neWhoKnocks
the0neWhoKnocks / Vim.md
Last active December 17, 2022 00:18
vim commands and settings

Vim


Commands

Normal Mode (commands prefixed with : may require ESC beforehand)

Command Description
:? Search for text. n for next result, SHIFT+n for previous result.
:m Move the current line after line ``.
@the0neWhoKnocks
the0neWhoKnocks / Linux Mint.md
Last active December 1, 2022 19:59
Linux Mint

Linux Mint


During Install

  • Installation Type
    • Erase disk and install
      • Advanced > use LVM

Remove Duplicate Svelte Classes (Loader)

Svelte has an open issue because of a "feature" that adds duplicate classses which breaks the expected cascade in favor of some inexplicable specificity. Instead of having to go through all your override/modifier rules and add !important to them, you can just add this WP plugin to strip out the duplicate classes.

// in ./.webpack/loader.remove-duplicate-svelte-classes.js

module.exports = function removeDuplicateSvelteClasses(source) {
  const SVELTE_RULE_REGEX = /\.svelte-[a-z0-9]+/g;
  const ruleMatches = (source.match(SVELTE_RULE_REGEX) || []);
@the0neWhoKnocks
the0neWhoKnocks / Codemods.md
Last active November 17, 2021 20:48
codemods

Codemods


Write a CodeMod

This example swaps out function name with another

source.js

console.log('this should be a warning');
@the0neWhoKnocks
the0neWhoKnocks / Bash Scripting.md
Last active March 29, 2023 09:50
Bash Scripting

Bash Scripting


Shebang

#!/usr/bin/env bash