Skip to content

Instantly share code, notes, and snippets.

@kbussell
kbussell / openfile.py
Last active May 11, 2020
open file references from terminal text
View openfile.py
#!/home/keith/.pyenv/shims/python3
import logging
import os
import re
import subprocess
php_re = re.compile(r"(.+)/(\w+\.php)\((\d+)\)")
LOCAL_ROOT = "/home/keith/Projects/tradesy/core"
@kbussell
kbussell / ctrlTap.lua
Last active Feb 13, 2021
Send escape key if the ctrl key is tapped. (Used along side remapping my Caps Lock key to ctrl) Thanks to @asmagill 's examples for a starting point.
View ctrlTap.lua
local alert = require("hs.alert")
local timer = require("hs.timer")
local eventtap = require("hs.eventtap")
local events = eventtap.event.types
local module = {}
-- timeout for ctrol key
module.timeFrame = .25
View ipython.out
In [1]: j = JsonModel.objects.create(data={'some': 'data'})
In [2]: j.id
Out[2]: 1
In [3]: repr(j.data)
Out[3]: "{'some': 'data'}"
In [4]: j.save()
View models.py
from django.db import models
from django.utils.functional import curry
class PrivateFieldDescriptor(object):
def __init__(self, field):
self.field = field
def __get__(self, instance, type=None):
if instance is None:
View keybase.md

Keybase proof

I hereby claim:

  • I am kbussell on github.
  • I am kbussell (https://keybase.io/kbussell) on keybase.
  • I have a public key whose fingerprint is B4D5 BE0C 2CAE 41DB 3614 46D5 7F86 0EA0 5A34 5886

To claim this, I am signing this object:

View test.bash
#!/bin/bash -x
echo wokkawokka