Skip to content

Instantly share code, notes, and snippets.

View cabrinha's full-sized avatar

cabrinha

  • California
View GitHub Profile
@cabrinha
cabrinha / hammerspoon-init.lua
Created November 11, 2015 19:10
~/.hammerspoon/init.lua
-- Call up the bar
require("bar")
-- Hotkey mash
local mash = {"cmd", "alt", "ctrl"}
local mash_move = {"cmd", "ctrl"}
hs.alert("Reloaded Config")
@cabrinha
cabrinha / bar.lua
Last active November 12, 2015 20:31
trying to create a status bar in hammerspoon
-- Trying to make a status bar
-- Internaught 11/11/15
-- Something about the screens ...
-- I guess this draws a border?
-- local boxBorder = 2
-- Lets draw the box, on as many screens as we have, across the top
for _,screen in ipairs(hs.screen.allScreens()) do
#!/bin/bash
PANEL_FIFO=/tmp/bar.fifo
PRINTER='/Users/yuppie/devel/bar/bin/printer.js'
NODE=/usr/local/bin/node
[ -e $PANEL_FIFO ] && rm "$PANEL_FIFO"
mkfifo $PANEL_FIFO
# Run bar and keep reading from fifo
@cabrinha
cabrinha / .xinitrc
Created November 10, 2015 17:32
OSX
PATH=$PATH:/usr/local/bin
bspsource $HOME/.profile
export LANG="en_US.UTF-8"
exec >>~/.xsession-errors 2>&1
sxhkd -c $HOME/.config/sxhkd/sxhkdrc &
exec bspwm -c $HOME/.config/bspwm/bspwmrc
@cabrinha
cabrinha / keybase.md
Created October 20, 2015 18:40
proofing the keys

Keybase proof

I hereby claim:

  • I am internaught on github.
  • I am yuppie (https://keybase.io/yuppie) on keybase.
  • I have a public key whose fingerprint is 5B5B F3DA E042 BD83 7CFF 36B1 F4E1 6BED 1170 9D47

To claim this, I am signing this object:

@cabrinha
cabrinha / photon.pl
Last active October 10, 2015 14:33
api wrapper
#!/usr/bin/env perl
use strict;
use warnings;
use v5.22.0;
use Mojo::UserAgent;
use Mojo::URL;
use Data::Dumper;
use Pod::Usage;
@cabrinha
cabrinha / alister.py
Last active October 2, 2015 16:03
yet another irc bot, in Python!
#!/usr/bin/env python
import socket
irc_host = "chat.freenode.net"
irc_port = 6667
irc_nick = "alister"
irc_chan = "##bikes"
ircsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@cabrinha
cabrinha / ud.pl
Last active September 29, 2015 19:42
Urban Dictionary API JSON formatting manipulation using perl
#!/usr/bin/env perl
use strict;
use warnings;
use diagnostics;
use v5.20.1;
use Data::Dumper;
use Mojo::URL;
#!/bin/bash
#
# Author: Twily 2014
# Description: Records a window or the desktop and converts the video to webm format.
# Requires: ffmpeg, xwininfo, libnotify, keybind (C-A-x) in your WM to "pkill -f 'x11grab'"
# Useage: $ sh screencast -h|--help
#
# Make GIFs: http://pastebin.com/ReNXZdGV
MODE="desktop" # Default "desktop" ["window"|"desktop"]
@cabrinha
cabrinha / perl-build.sh
Created July 31, 2015 17:01
Let's build perl-5.22.0 from source!
wget -qO - https://raw.github.com/tokuhirom/Perl-Build/master/perl-build | perl - 5.22.0 ~/perl-5.22.0
echo export PATH="~/perl-5.22.0/bin:$PATH" >> ~/.bashrc; source ~/.bashrc
wget -qO - https://cpanmin.us | perl - App::cpanminus