Skip to content

Instantly share code, notes, and snippets.

View hoop33's full-sized avatar
🏈

Rob Warner hoop33

🏈
View GitHub Profile
@hoop33
hoop33 / Circle.java
Created May 12, 2011 14:31
SWT program that draws a circle and plots 9 regularly-spaced points on its circumference
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.PaintEvent;
import org.eclipse.swt.events.PaintListener;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Canvas;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class Circle {
public void run() {
source 'http://rubygems.org'
gem 'rails', '2.3.11'
gem 'rack-ssl-enforcer'
#gem 'mysql', '=2.7'
gem 'mysql2', '0.2.7'
gem 'warden', '= 0.10.3'
gem 'devise', '= 1.0.9'
@hoop33
hoop33 / gist:1069220
Created July 7, 2011 10:00
Output from bundle install
Using rake (0.8.7)
Using BlueCloth (1.0.1)
Using aaronh-chronic (0.3.9)
Using aasm (2.2.0)
Using activesupport (2.3.11)
Using rack (1.1.2)
Using actionpack (2.3.11)
Using actionmailer (2.3.11)
Using builder (3.0.0)
Using braintree (2.10.0)
@hoop33
hoop33 / functions.zsh
Created September 2, 2015 14:51
Making "java -v", "java --version", and "java version" work
function java() {
case $* in
-v)
;&
version)
;&
--version) shift 1; command java -version ;;
*) command java "$@" ;;
esac
}
@hoop33
hoop33 / .ctags
Created January 17, 2018 16:02
.ctags entries for GraphQL
--langdef=graphql
--langmap=graphql:.graphql
--regex-graphql=/^type[ \t]+([^{]+){/\1/t,type/
--regex-graphql=/^input[ \t]+([^{]+){/\1/i,input/
--regex-graphql=/^[ \t]*([a-zA-Z]+)\(/\1/f,func/
@hoop33
hoop33 / ocsh.zsh
Created August 11, 2019 13:55
OpenShift: zsh function that uses fzf and oc to rsh into a pod
function ocsh() {
local pods pod
pods=$(oc get pods | cut -d' ' -f 1 | sed '1d' | grep -v '\-build' | grep -v '\-deploy') &&
pod=$(echo "$pods" | fzf +m) &&
oc rsh $(echo "$pod")
}
@hoop33
hoop33 / .vimrc
Created October 11, 2019 13:08
Reformatting X12 in Vim
nnoremap <leader>x12 :%s/\n//g<cr>:%s/\~/\~\r/g<cr>gg:nohlsearch<cr>
@hoop33
hoop33 / kittycolors.zsh
Last active February 9, 2023 22:26
A shell function for displaying your kitty theme colors
# Prerequisites:
# kitty: https://sw.kovidgoyal.net/kitty/
# kitty themes: https://github.com/dexpota/kitty-themes
# pastel: https://github.com/sharkdp/pastel
# Usage:
# $ kittycolors
# $ kittycolors -s
kittycolors() {
if [[ $# -eq 0 ]]; then
grep -o "#[a-f0-9]\{6\}" ~/.config/kitty/current-theme.conf | pastel color
@hoop33
hoop33 / config.nu
Created April 5, 2023 20:34
Nushell functions for `git switch` and `git branch -d` using fzf
# git branch switch
def gbs [] {
let branch = (
git branch |
split row "\n" |
str trim |
where ($it !~ '\*') |
where ($it != '') |
str join (char nl) |
fzf --no-multi