Skip to content

Instantly share code, notes, and snippets.

View Aldaviva's full-sized avatar
🆒
This user is COOL

Ben Hutchison Aldaviva

🆒
This user is COOL
View GitHub Profile
@Aldaviva
Aldaviva / Disable programs from reopening.md
Last active June 24, 2020 14:55
Disable Windows 10 or Server ≥ 2016 from reopening programs on startup or reboot.

Usage

  1. Save the disable-program-reopen.ps1 file below to a directory on your computer, such as %SYSTEMROOT%\System32\GroupPolicy\User\Scripts\Logon.
  2. Allow unsigned local PowerShell scripts to run on your computer.
    1. Open PowerShell as an administrator.
    2. Run the following command and answer Y when it prompts you.
      Set-ExecutionPolicy RemoteSigned
  3. Set a Group Policy to run this script when users log on.
  4. Open the Local Group Policy Editor (gpedit.msc, or search for Group Policy in the Start Menu).
@Aldaviva
Aldaviva / Useful programs.md
Last active April 5, 2023 08:46
Applications and extensions that are handy to install in different operating systems and browsers

Windows

Program Category Notes
7+ Taskbar Tweaker Tweaking Adjust taskbar behavior.
AltSnap Window management Easily move windows with mouse.
Autoruns Startup management Turn off startup processes.
CCleaner System cleanup Upsells are a little annoying.
dBpoweramp Audio encoder Transcode music batches in parallel.
DisplayFusion Tweaking Plethora of multi-monitor, desktop, and shell tweaks.
Driver Store Explorer System cleanup Uninstall unused drivers.
@Aldaviva
Aldaviva / Easy PowerShell Remoting.md
Last active July 30, 2024 02:54
Easy PowerShell Remoting

Easy PowerShell Remoting

PowerShell Remoting allows you to connect to a remote shell on another Windows computer.

The server is the Windows computer that will host the shell, and that you will connect to. The client is the Windows computer that will create the connection, on which you will see and interact with the shell.

These steps assume a workgroup with Windows 10 or Server 2016 or later on the server, and Windows 7 or later on the client. It assumes that the client is running with a user account that also exists on the server with the same password. Neither the server nor the client need to be joined to a domain or using Kerberos.

Prerequisites

@Aldaviva
Aldaviva / unicode-code-units.md
Last active October 8, 2022 13:02
Examples of Unicode codepoints with different UTF-8 and UTF-16 byte counts. Try pasting these into your program to see if it can handle multi-byte characters.
Glyph Unicode codepoint UTF-8 code units UTF-8 bytes UTF-16 code units UTF-16LE bytes
B U+0042 1 0x42 1 0x42 0x00
ÿ U+00FF 2 0xC3 0xBF 1 0xFF 0x00
U+2603 3 0xE2 0x98 0x83 1 0x03 0x26
💩 U+1F4A9 4 0xF0 0x9F 0x92 0xA9 2 0x3D 0xD8 0xA9 0xDC
@Aldaviva
Aldaviva / curl cheat sheet.md
Last active May 19, 2022 14:16
Curl Cheat Sheet: How is anyone supposed to remember curl commands? I hate command-line utilities.

curl cheat sheet

$ curl [arguments] 'https://my.url.com/path/file.ext?a=b&c=d'

Request

Nickname Argument Description
Insecure -k Accept invalid TLS server certificates
@Aldaviva
Aldaviva / Stopwatch.java
Created January 30, 2019 05:15
How long does an operation take in Java?
final long start = System.nanoTime();
// operation being timed
LOGGER.trace("Operation took {} ms", (System.nanoTime() - start) / 1_000_000);
@Aldaviva
Aldaviva / Fix Registry.md
Last active October 15, 2023 11:21
Remove cruft from Windows context menus and file associations that kept getting added back by updates

This gist was moved to a GitHub repository to make it easier to diff changes and keep in sync with a clone on a filesystem.

@Aldaviva
Aldaviva / Vivaldi customizations.md
Last active September 8, 2021 09:10
Customizations to the Vivaldi web browser, including a fancy persistence strategy.
@Aldaviva
Aldaviva / Maximum tab width.md
Last active June 20, 2024 10:58
How to make tabs wider in browsers and operating systems

By increasing the maximum width of tabs and taskbar buttons, you can

  • see more of their text labels without truncation,
  • have a larger hit area for your mouse pointer, and
  • make better use of the space on your wide monitor.

This does not break the resizing logic when you open more tabs, so the worst-case scenario behavior is unchanged. For example, you could set the maximum tab width to a size at least as wide as your monitor. Then, when you have one tab open, it will consume 100% of the available space. Next, when you open another tab, they will each consume 50% of the available space. When the minimum tab width is reached, the existing overflow or scrolling logic will still apply.

Make tabs wider in
@Aldaviva
Aldaviva / cart
Last active March 28, 2018 05:30
Carthage's CLI sucks. I need to pass all these flags, it can't remember them. You have to bootstrap each time you pull? "Bootstrap" means first time! "Update" is too ambiguous. The hidden cache gets corrupted. There, I fixed it for you, Carthage developers, you fucking scum of the earth.
#!/bin/bash
PLATFORM=Mac
function main {
if [ "$1" == "repin" ]
then
update
elif [ "$1" == "install" ]
then