Skip to content

Instantly share code, notes, and snippets.

View eakst7's full-sized avatar

Ed King eakst7

View GitHub Profile
@eakst7
eakst7 / HeapPollutionDemo.java
Created April 22, 2022 11:32
Demo of heap pollution via varargs parameters in Java
package com.ibm.scrt.fvt;
/**
* This class is a demonstration of "potential heap pollution" via
* varargs parameters, and the @SafeVarargs annotation (and when it's
* safe to use).
*/
public class HeapPollutionDemo {
static class Box<T> {
@eakst7
eakst7 / fish_right_prompt.fish
Last active October 17, 2023 19:42 — forked from britishtea/fish_right_prompt.fish
My right prompt for the fish shell.
function fish_right_prompt -d "Write out the right prompt"
# Stolen and adapted from: https://gist.github.com/britishtea/39ad478fa5180e1432a2
set -l exit_code $status
set -l is_git_repository (git rev-parse --is-inside-work-tree 2>/dev/null)
set_color black
# Print a red dot for failed commands.
if test $exit_code -ne 0
set_color red
set -g prefix C-a
set -g default-terminal "screen-256color"
# As of tmux 2.1:
setw -g mouse
bind-key -T prefix C-c new-window
bind-key -T prefix C-n next-window
bind-key -T prefix C-p previous-window
bind-key -T prefix C-\\ split-window -h