Skip to content

Instantly share code, notes, and snippets.

Pretty swamped with work-work

Brad Greenlee bgreenlee

Pretty swamped with work-work
View GitHub Profile
bgreenlee /
Last active February 7, 2022 21:24
Wordle "Solver"
#!/usr/bin/env python3
from datetime import datetime
import urllib.request
import re
# grab the word list
words_url = ''
req = urllib.request.Request(words_url, data=None,
'User-Agent': 'Wordle "Solver" 1.0'
bgreenlee /
Last active January 14, 2020 22:29
Data Tech Blog Club FAQ

Data Tech Blog Club FAQ

What is Data Tech Blog Club?

Blog Club is a weekly meeting where we discuss an article or short paper on a topic at least vaguely adjacent to our work.

Can I Come to Blog Club?

Yes! The more the merrier! You don't have to be in the Data Tech org. Meetings are Monday at 11:30a Eastern in A-511. Hit up @brad to get an invite.

Do I Have to Read the Article?

Well, no, but you'll get more out of it if you do. The articles we pick usually don't require more than fifteen minutes or so to read. You can do it! But, if you totally spaced and it's five minutes before the meeting and what was the article worries, come anyway. Someone will give a summary and we always end up having an interesting discussion.

View cacophony.php
if (strpos(`uname`, 'Darwin') === false) {
fwrite(STDERR, "This only works on macOS, sorry.\n");
$voices = array_map(
function($voice) {
return (explode(' ', $voice))[0];
bgreenlee / rescuewindows.lua
Created January 24, 2018 04:46
Hammerspoon function to move off-screen windows onto the main screen
View rescuewindows.lua
-- Rescue Windows
-- Move any windows that are off-screen onto the main screen
function rescueWindows()
local screen = hs.screen.mainScreen()
local screenFrame = screen:fullFrame()
local wins = hs.window.visibleWindows()
for i,win in ipairs(wins) do
local frame = win:frame()
if not frame:inside(screenFrame) then
win:moveToScreen(screen, true, true)
View Document.swift
import Cocoa
class Document: NSDocument {
@IBOutlet weak var textField: NSTextField!
var content = ""
override init() {
View Default (OSX).sublime-keymap
{ "keys": ["super+f4"], "command": "public_gist_from_selection" }
bgreenlee / UIImage+Resize.swift
Created November 23, 2015 05:24
Swift port of UIImage+Resize, UIImage+Alpha, and UIImage+RoundedCorner, from
View UIImage+Resize.swift
// UIImage+Resize.swift
// Port of UIImage+Resize.m
// from
import Foundation
import UIKit
extension UIImage {
bgreenlee / rdio-music-to-code-by-csv
Created November 20, 2015 16:57
Music to Code By Playlist
View rdio-music-to-code-by-csv
Yppah,Blue Schwinn
Yppah,D. Song
Yppah,R. Mullen
Yppah,Film Burn
Yppah,Never Mess With Sunday
Yppah,Happy to See You
Yppah,Soon Enough
Yppah,Paper Knife
Yppah,Golden Braid
Yppah,Three Portraits
bgreenlee / WiFiInfo.swift
Created November 7, 2015 23:05
Swift Class to encapsulate wifi network info
View WiFiInfo.swift
// WiFiInfo.swift
// Created by Brad Greenlee on 11/7/15.
import Foundation
import CoreWLAN
extension CWPHYMode: CustomStringConvertible {
bgreenlee /
Last active August 29, 2015 14:27
Post a random gif (with random icon) to a Slack channel
curl -X POST --data-urlencode "payload={\"channel\": \"#random\", \"username\": \"randombot\", \"text\": \"$(curl -s '' | sed -nE 's/^.*image_original_url":"([^"]+)".*$/\1/gp' | sed 's/\\//g')\", \"icon_emoji\": \":$(curl -s | sed -n -E 's/^.*<span class="name".*>(.*)<\/span>.*$/\1/gp' | perl -MList::Util -e 'print List::Util::shuffle <>' | head -1):\"}" $HOOK_URL