Skip to content

Instantly share code, notes, and snippets.

View kherge's full-sized avatar

Kevin Herrera kherge

View GitHub Profile
@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 / 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 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 / README.md
Last active February 12, 2022 12:20
Installs PHPBrew and its dependencies.

PHPBrew Installer

This script is for simplifying the process of installing phpbrew for managing different versions of PHP.

  • The phpbrew.sh script installs dependencies and sets up the current user to use phpbrew.
  • The gd.sh script install the GD extension if you get errors using the usual install command.

Tips

@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 / issues.md
Last active August 22, 2021 18:04
How to organize GitHub issues.

Issues

Did some searching online to see how others have handled organizing issues on GitHub for their own projects. This one by Robin Powered is by far the best I have seen so far. I have broken down the image in the blog post so that it can be easily copied and pasted into my own GitHub issue label manager and even put my own spin on it.

Platform

If the repository covers multiple parts, this is how we designate where the issue lives. (i.e. iOS and Android for cross-platform tablet app).

@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 / 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