Skip to content

Instantly share code, notes, and snippets.

View kherge's full-sized avatar

Kevin Herrera kherge

View GitHub Profile
@kherge
kherge / README.md
Last active March 4, 2023 02:52
AWS CLI Extension

AWS CLI Extension

A simple POSIX compatible shell script to allow aws CLI commands and subcommands to be added or overwritten.

Usage

There are two naming conventions for your executables.

@kherge
kherge / bash.sh
Last active July 13, 2022 14:45
macOS Customizations
# Docker spacer icon.
defaults write com.apple.dock persistent-apps -array-add '{tile-data={}; tile-type="spacer-tile";}' \
&& killall Dock
# Faster dock hiding/showing.
defaults write com.apple.dock autohide-delay -float 0 \
&& defaults write com.apple.dock autohide-time-modifier -float 0.5 \
&& killall Dock
@kherge
kherge / poc.sh
Last active November 3, 2021 06:24
Using temporary pipes to run shell code from binary executables.
#!/bin/sh
###
# Uses the 3 pipe to run commands.
#
# In Rust: https://stackoverflow.com/a/54858159
##
inner()
{
echo 'echo "Hello, before!"' >&3
@kherge
kherge / README.md
Last active July 1, 2021 22:59
Containerized Development Environment Manager

Containerized Development Environment Manager

Uses Docker CLI to create a development environment as a container.

kherrera@machine Desktop % ./dev shell
[+] Building 1.5s (11/11) FINISHED                                                                                       
 => [internal] load build definition from Dockerfile                                                                0.0s
 => => transferring dockerfile: 882B                                                                                0.0s
@kherge
kherge / README.md
Created March 30, 2021 19:14
PowerToys Settings

PowerToys Settings

These files can be pulled from/saved to %USERPROFILE%\AppData\Local\Microsoft\PowerToys.

Gist Name FS Path
keyboard.json Keyboard Manager\default.json

Keyboard Manager

@kherge
kherge / Stylus.css
Last active May 17, 2023 18:11
Google Calendar Dark Mode
/* calendar.google.com */
:root {
--base-bg-color: #111111;
--base-fg-color: #eeeeee;
--border-color: #202020;
--button-hover-bg-color: #333333;
--button-hover-border-color: #404040;
@kherge
kherge / README.md
Last active July 9, 2020 16:12
Change input source through data display channel (DDC).

Change Input Source

A simple command line tool that uses ddccontrol to find named input sources and change to them.

Usage

cis -d *U3818DW* -s usb-c
@kherge
kherge / Example.java
Last active November 22, 2023 11:14
Null Coalescing in Java
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.Optional;
public class Example {
public static void main(String []args) {
// Create a series of nullable objects.
Test a = new Test();
@kherge
kherge / README.md
Last active January 17, 2017 18:10
A script for switching between multiple versions of PHP.

PHP Alias

This is a BASH shell script that will,

  1. Keep track of a list of PHP interpreters available.
  2. Allow you to switch quickly between them.
  3. Automatically switch to a different version when entering a directory.

Installation