Skip to content

Instantly share code, notes, and snippets.

View bbenne10's full-sized avatar

Bryan Bennett bbenne10

View GitHub Profile
@bbenne10
bbenne10 / Pass.applescript
Created January 26, 2021 16:11
pass applescript
property defaultPass : "someDefaultPass"
property clearAfter : 45
property passPath : "pathToPass"
property passStore : "/Users/<userName>/\\.password-store\\/" -- backslash escaping '.' helps sed later but doesn't affect find.
on run {input, parameters}
try
set availablePasswords to every paragraph of (do shell script "find " & passStore & " -name '*.gpg' | sed -E 's;^" & passStore & "(.+)\\.gpg$;\\1;'")
set entity to choose from list availablePasswords with prompt "Which password?" default items {defaultPass}
set pw to do shell script passPath & " " & entity & " | head -n 1"

Keybase proof

I hereby claim:

  • I am bbenne10 on github.
  • I am bbenne10 (https://keybase.io/bbenne10) on keybase.
  • I have a public key ASDXhuEiyIO8xp2q6nVYxPUM3_rOCVa48GNq3A9k6-btfAo

To claim this, I am signing this object:

@bbenne10
bbenne10 / init.lua
Created September 19, 2017 19:51
Hammerspoon configuration
local tiling = require 'hs.tiling'
local hotkey = require 'hs.hotkey'
local mash = {'ctrl', 'cmd', 'alt', 'shift'}
layout = 'main-vertical-variable'
border = nil
local log = hs.logger.new('bbenne10Config','debug')
-- utility functions
function applyLayout(newLayout)
<!-- this needs to be at 'static/index.tmpl' relative to test.py. wall.png can be any renderable file...
I just used a random wallpaper I have -->
<html>
<body>
<img src="{{ url_for('static', filename='wall.png') }}">
</body>
</html>
#! /usr/bin/python
import re
from lxml.html import html5parser
from lxml.cssselect import CSSSelector
import pymongo
import requests
coll = pymongo.Client().guotewall.quotes
http://www.youtube.com/watch?v=tEcggRukZCs
http://www.youtube.com/watch?v=irlW_65xkF
http://www.youtube.com/watch?v=knbkFOvfucQ
http://www.youtube.com/watch?v=Ly7-J0ze1x
http://www.youtube.com/watch?v=ykI7glq9LRE
http://www.youtube.com/watch?v=iRQFgSPGnwc
http://www.youtube.com/watch?v=-iYzuc_gM9U
http://www.youtube.com/watch?v=kTL9JaXgpMM
http://www.youtube.com/watch?v=EBmROluwLkc
http://www.youtube.com/watch?v=8er4CQCxPRQ
@bbenne10
bbenne10 / gist
Last active August 29, 2015 14:02
A python Gist creator & editor
#! /usr/bin/env python
from __future__ import print_function
from argparse import ArgumentParser, RawDescriptionHelpFormatter
import os.path
import subprocess
import sys
import requests
try: