Skip to content

Instantly share code, notes, and snippets.

View atelic's full-sized avatar

Eric Barbour atelic

View GitHub Profile
@atelic
atelic / tmux.conf
Last active November 5, 2023 23:39
A vim-friendly tmux config
# change prefix to Ctrl-a (like in gnu-screen)
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# shell
set -g default-command /bin/zsh
set -g default-shell /bin/zsh
@atelic
atelic / gulpfile.js
Created May 24, 2015 04:00
Basic gulpfile for minify and concat css and javascript
/*
Before using make sure you have:
npm install --save-dev gulp gulp-minify-css gulp-concat gulp-uglify gulp-autoprefixer gulp-sass
Make sure to change the directory names in the default watch function to the CSS/SCSS/SASS directories you are using so it reloads
*/
var gulp = require('gulp'),
minifyCSS = require('gulp-minify-css'),
concat = require('gulp-concat')
@atelic
atelic / i3prettylock.sh
Last active January 24, 2018 00:44
An i3lock script for a cool overlay blur
#!/bin/bash
LOCKDIR=/home/path/to/lock.png
scrot -e 'convert -blur 0x3 $f ~/lockbg.png;rm $f'
convert -gravity center -composite ~/lockbg.png $LOCKDIR/lock.png ~/lockfinal.png
i3lock -u -i ~/lockfinal.png
rm ~/lockfinal.png ~/lockbg.png

Setting up Keybase and GitHub signatures

  1. Install Keybase and login
    1. $ brew cask install keybase
    2. $ keybase login
  2. Create a new GPG key on keybase
    1. $ keybase pgp gen --multi
    2. Follow instructions
    3. Note: the email used in the key must match the user email in your ~/.gitconfig
  3. Set up Git to sign all commits
    1. $ gpg --list-secret-keys
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Alpha Component</key>
<real>1</real>
<key>Blue Component</key>
<real>0.20784313976764679</real>
@atelic
atelic / dmenu2.sh
Created May 15, 2015 05:13
An awesome dmenu2 script for a configurable program launcher
#!/bin/sh
# Define your battery device. Look up in '/sys/class/power_supply/' for a directory named 'BAT0' ( it also can be 'BAT1 or something else )
device='BAT0'
battery="$(cat /sys/class/power_supply/$device/capacity)%"
# Volume Status for alsa users
volume="$(amixer get Master | tail -1 | sed 's/.*\[\([0-9]*%\)\].*/\1/')"
# Define your preferred terminal
detect.hub.url=*********
detect.hub.timeout=120
detect.hub.username=*********
detect.hub.password=*********
detect.output.path=blackduck
@atelic
atelic / fizz_buzz.rb
Created May 13, 2015 05:04
Shortest FizzBuzz in ruby I can come up with
1.upto(100){|n|puts n%15==0?"FizzBuzz":n%5==0?"Buzz":n%3==0?"Fizz":n}
#! /usr/bin/env python
import json
import logging
import sys
import requests
logger = logging.getLogger(__name__)
TOKEN = 'YOUR_TOKEN'
import json
import requests
RPP = 'ezcuj'
CONTRIBUTORS_URL = 'https://api.osf.io/v2/nodes/{}/contributors/'
def get_contribs(url):
contributors_to_add = []