Skip to content

Instantly share code, notes, and snippets.

View gabeio's full-sized avatar

Gabe De Luca gabeio

View GitHub Profile

Keybase proof

I hereby claim:

  • I am gabeio on github.
  • I am gabeio (https://keybase.io/gabeio) on keybase.
  • I have a public key ASAKdtDd4b6-9AWe2-uU0KGQf5Z7wXP2-WE0gj5PsIE0aAo

To claim this, I am signing this object:

@gabeio
gabeio / pauser.sh
Created October 25, 2016 01:55
pauser
#!/bin/bash
# A small script to keep a laptop cool while running something like an install for a long time
while true; do
kill -CONT $1
sleep 1
kill -STOP $1
sleep 10
done
@gabeio
gabeio / pauser.sh
Last active October 25, 2016 02:35
process pauser
#!/bin/bash
# A small script to keep a laptop cool while running something like an install for a long time
# in this version it pauses all of the given process by name
# usage:
# ./pauser.sh <process name> <pause interval>
while true; do
pkill -CONT $1
sleep 1
@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"
@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 / 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 / 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:

#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 / 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
@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>()`;