Skip to content

Instantly share code, notes, and snippets.

💭
KNEE DEEP IN THE HOOPLA

Josh Holbrook jfhbrook

💭
KNEE DEEP IN THE HOOPLA
Block or report user

Report or block jfhbrook

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jfhbrook
jfhbrook / .vimrc
Created Jul 30, 2019
my work vimrc
View .vimrc
"vundle
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'connorholyday/vim-snazzy'
Plugin 'junegunn/seoul256.vim'
Plugin 'morhetz/gruvbox'
@jfhbrook
jfhbrook / target.log
Created Jul 27, 2019
The sqlite query planner solving this whiteboarding problem for me
View target.log
sqlite> select * from ints;
1
2
3
4
5
6
7
11
12
View bad_ideas.py
@dbus_method([Request], Response)
async def mad_science(ctx, message):
print('creating underlying and such')
underlying = Underlying
req = Request(message=message)
print('awaiting send')
payload = await ctx.send(request)
@jfhbrook
jfhbrook / dbus_proxy.py
Last active Jul 23, 2019
Potential API for building remote objects over dbus
View dbus_proxy.py
import attr
import click
import txdbus
from korbenware.cli import async_command
from korbenware.dbus import dbus_property, Str
from korbenware.dbus.proxy import dbus_proxy, dbus_proxy_method
# Here we have a class that has no knowledge of dbus.
#
View what_i_want.txt
$ op signin mysubdomain # don't want to have to use an eval, a wrapper bash function should take care of this for me
$ op get [tab][tab] # this should tab-complete the resource
$ op get item S[tab][tab] # this should tab-complete the item name
$ op get item "Some Login" --clipboard # this should grab my password and put it directly in my clipboard - no json blob
@jfhbrook
jfhbrook / chilltimer
Created Jul 8, 2019
A dirt simple timer app for Linux
View chilltimer
#!/bin/bash
parse_timespan () {
# Thanks to my dogs at StackOverflow
# https://stackoverflow.com/questions/40460727/bash-convert-time-interval-string-to-nr-of-seconds
date -d "1970-01-01 00:00:00 UTC $1" '+%s'
}
TIMESPAN=${1}
MESSAGE=${2}
View .xinitrc
#/usr/bin/env bash
userresources=$HOME/.Xresources
usermodmap=$HOME/.Xmodmap
sysresources=/etc/X11/xinit/.Xresources
sysmodmap=/etc/X11/xinit/.Xmodmap
if [ -f $sysresources ]; then
xrdb -merge $sysresources
fi
@jfhbrook
jfhbrook / twisted-magics.ipynb
Last active Jun 16, 2019
A demo of what I'd like to see out of twisted support in ipython - this appears to work! But it requires an extra library.
View twisted-magics.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jfhbrook
jfhbrook / async_cooperator.ipynb
Last active Jun 16, 2019
A demo of a subclass of twisted.internet.task#Cooperator that uses async iterators
View async_cooperator.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jfhbrook
jfhbrook / conda_ld.sh
Last active Jun 14, 2019
A script for managing the ld linker used by a conda env
View conda_ld.sh
#!/usr/bin/env bash
# Sometimes, when using pip in anaconda environments, building python source
# packages will fail because conda vendors a custom `ld` linker in each
# conda environment. This can cause error messages such as
# `file not recognized: file format not recognized`. For example, here's an
# error someone had with pytorch when trying to compile it from source in
# a conda environment:
#
# https://github.com/pytorch/pytorch/issues/16683
You can’t perform that action at this time.