Skip to content

Instantly share code, notes, and snippets.

View gabeio's full-sized avatar

Gabe De Luca gabeio

View GitHub Profile
@gabeio
gabeio / vim.regex
Created February 2, 2023 19:49
vim regex converts terraform variables to outputs (for debugging)
%s/variable "\(.*\)" {\_.\{-}}/output "\1" {\r value = var.\1\r}/g
@gabeio
gabeio / LICENSE
Created April 15, 2021 05:02 — forked from wlib/LICENSE
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@gabeio
gabeio / k8s-svc-annotations.md
Created January 13, 2021 06:28 — forked from mgoodness/k8s-svc-annotations.md
AWS ELB-related annotations for Kubernetes Services (as of v1.12.0)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-emit-interval (in minutes)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-enabled (true|false)
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-name
  • service.beta.kubernetes.io/aws-load-balancer-access-log-s3-bucket-prefix
  • service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags (comma-separated list of key=value)
  • service.beta.kubernetes.io/aws-load-balancer-backend-protocol (http|https|ssl|tcp)
  • service.beta.kubernetes.io/aws-load-balancer-connection-draining-enabled (true|false)
@gabeio
gabeio / userhelpers.py
Created September 12, 2019 06:49 — forked from jaylett/userhelpers.py
Django template filters for getting various user-specific things off models
"""
Some simple filters
* `user_can`, which filters an object taking a string
parameter, returning True or False depending on whether the current
user "can" do the action in the parameter. This is done by calling
`user_can_<action>` on the object.
Anonymous users always return `False`.
* `user_has`, which pulls the result of the `user_has_<feature>()`;
@gabeio
gabeio / kitty.conf
Created April 2, 2019 16:16
Kitty Term Config
# vim:fileencoding=utf-8:ft=conf:foldmethod=marker
#: Fonts {{{
#: kitty has very powerful font management. You can configure
#: individual font faces and even specify special fonts for particular
#: characters.
font_family Fira Mono
# bold_font auto

#Code of Conduct

This is not a community project. This is my project. I know that will disappoint some people, but I do this for fun in my own spare time. If it stops being fun, I will stop working on it, which will pretty much kill the project. There are millions of projects in the world and the only reason they continue (if they actually do) is because the maintainers stubbornly stick at it.

With that in mind, here is the code of conduct: If it is fun for me then it is good. If it is not fun for me, then it is not good.

Things I find fun include: Bug reports that explain what you saw and what you expected to see. Suggestions for features that would make your life better. Stories of how the software so far has already made your life better. Entertaining stories of how you used the software (bonus points if it includes pictures of cats). Offers to volunteer to improve something (super bonus points if you actually improve it). Questions about how the software works. Offers to write documentation (super, exe

@gabeio
gabeio / pr.md
Created November 17, 2017 21:08 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@gabeio
gabeio / RandomSelect.cs
Created November 2, 2017 16:59
Generic Random Select
class RandomSelect<T>
{
private Random r;
public RandomSelect()
{
this.r = new Random();
}
public T Select(List<T> arr)
{
@gabeio
gabeio / zstd.cs
Created September 11, 2017 15:44 — forked from dimzon/zstd.cs
zstd streaming api wrapper
using System;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Runtime.InteropServices;
namespace ZstdCompression
{
public static class Zstd
{
@gabeio
gabeio / watch-build.sh
Last active January 3, 2017 04:09
golang watch and build
CompileDaemon \
--color=true\
--recursive=false\
--include="*.go"\
--exclude-dir="vendor"\
--build="go build --race"\
--command="pkill -HUP torch"