Skip to content

Instantly share code, notes, and snippets.

@uberbrodt
uberbrodt / git-clean-branches
Last active April 6, 2023 20:10
Delete local git branches that have been merged to $BRANCH
#!/usr/bin/env bash
#vi: ft=bash
############################################################
# Help #
############################################################
Help()
{
# Display Help
echo "Delete all local branches that have been merged to BRANCH"
@uberbrodt
uberbrodt / keybase.md
Created January 2, 2021 00:26
keybase.io Github verification

Keybase proof

I hereby claim:

  • I am uberbrodt on github.
  • I am uberbrodt (https://keybase.io/uberbrodt) on keybase.
  • I have a public key ASBHOEa8opITBTChZxPN74K2po2jLA099IQauG_-KDAK-wo

To claim this, I am signing this object:

@uberbrodt
uberbrodt / init.vim
Created June 25, 2020 17:53
my neovim config
set secure
call plug#begin('~/.local/share/nvim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'w0rp/ale'
Plug 'rbgrouleff/bclose.vim'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'Shougo/deoplete.nvim'
" Plug 'luochen1990/rainbow' " conflicts with endwise and vim-textobj-elixir
@uberbrodt
uberbrodt / pre-push
Last active May 2, 2017 00:19
git pre-push script to run tests.
#!/usr/bin/ruby
require 'open3'
remote_name, push_url = ARGV
TEST_COMMAND = 'gradle test acceptanceTest -PverboseTests'
CURRENT_BRANCH = `git symbolic-ref HEAD`
@uberbrodt
uberbrodt / screenbright
Created March 20, 2017 00:45
Hacked together script to increment/decrement screen brightness for X11 Intel modeset driver
#!/usr/bin/ruby
=begin rdoc
If you are PERSON with PROBLEMS, such as deciding to use a
window manager that has you manually mapping your media keys
to adjust screen brightness, but xbacklight doesn't work because
you're using the intel modesetting driver, than do *I* have the
backlight adjustment script for YOU.
=end
@uberbrodt
uberbrodt / java_optional_guidelines.md
Last active September 20, 2016 00:44
Draft of guidelines for using Java 8 Optional

#Optional Java 8's Optional solves a very specific problem for Java programmers: what does null mean? By using it in a public API, you can indicate clearly to users of your API that there may or may not have a value. Additionaly, it will also give end users some helpful methods for handling that problem.

However, there are some caveats, related to how it was implemented. In order to make the best usages of it, here are a few guidelines. They are not not "laws" or even "rules" per se; but rather a framework to guide our thinking and usage.

##Do not use Optional as a class property. Optional objects do not implement Serializable. If you expect your class to be serialized, then this will be a problem.

@uberbrodt
uberbrodt / .ctags
Created February 28, 2016 20:17
golang exuberant-ctags
--langdef=Go
--langmap=Go:.go
--regex-Go=/func([ \t]+\([^)]+\))?[ \t]+([a-zA-Z0-9_]+)/\2/d,func/
--regex-Go=/var[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,var/
--regex-Go=/type[ \t]+([a-zA-Z_][a-zA-Z0-9_]+)/\1/d,type/
@uberbrodt
uberbrodt / SortedSetBadImpl.java
Created February 24, 2016 05:07
Why, oh why?
package net.uberbrodt;
import java.util.*;
public class SortedSetBadImpl {
public static void main(String[] args) {
SortedSetBadImpl.testBadComparable();
}
@uberbrodt
uberbrodt / basicstruct.go
Created January 10, 2016 20:18
Exemplar Model Generator Example
package main
import "time"
//import "log"
//import "reflect"
import "github.com/traitify/common-go/unixtime"
type Basicstruct struct {
id int `db:"id"`
@uberbrodt
uberbrodt / dtruss_imagick_go.out
Created November 19, 2015 22:18
Output of dtruss -f ./signal_deadlock_example
2015/11/19 16:15:17 Initializing Imagemagick
PID/THRD SYSCALL(args) = return
12905/0xa45914: thread_selfid(0x0, 0x0, 0x0) = 10770708 0
12905/0xa45914: open(".\0", 0x0, 0x1) = 3 0
12905/0xa45914: fstat64(0x3, 0x7FFF5FBFE6A0, 0x1) = 0 0
12905/0xa45914: fcntl(0x3, 0x32, 0x7FFF5FBFE950) = 0 0
12905/0xa45914: close(0x3) = 0 0
12905/0xa45914: stat64("/Users/cbrodt/Projects/signal_deadlock_example_go/src/github.com/uberbrodt/signal_deadlock_example\0", 0x7FFF5FBFE610, 0x7FFF5FBFE950) = 0 0
12905/0xa45914: csops(0x0, 0x0, 0x7FFF5FBFE950) = 0 0
12905/0xa45914: issetugid(0x0, 0x0, 0x7FFF5FBFE950) = 0 0