Skip to content

Instantly share code, notes, and snippets.

View mwerner's full-sized avatar

Matthew Werner mwerner

  • Oakland, CA
View GitHub Profile
@mwerner
mwerner / README.md
Last active June 14, 2022 19:44
Kangaroo Word Finder

Kangaroo Word Finder

This application looks through a word list and compares all other words in the list to find which words are found in other words

Kangaroo Word: A word that contains its synonym within it (ex: rambunctious & raucous: RAmbUnCtiOUS)

Joey Word: A word that is a synonym with another word it’s found within

Requirements to run:

  • Your wordlist kept at ./words.txt
@mwerner
mwerner / app_watcher.lua
Created November 1, 2017 20:11
Hammerspoon scripts
function applicationWatcher(appName, eventType, appObject)
if (eventType == hs.application.watcher.activated) then
if (appName == "Finder") then
-- Bring all Finder windows forward when one gets activated
appObject:selectMenuItem({"Window", "Bring All to Front"})
end
end
end
local appWatcher = hs.application.watcher.new(applicationWatcher)
install PostgreSQL 9 in Mac OSX via Homebrew
Mac OS X Snow Leopard
System Version: Mac OS X 10.6.5
Kernel Version: Darwin 10.5.0
Install notes for PostgreSQL 9.0.1 install using Homebrew:
sh-3.2# brew install postgresql

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@mwerner
mwerner / bart.rb
Last active November 17, 2016 00:56
Bart Realtime CLI
#!/usr/bin/env ruby
# $ bart
# Usage:
# bart stations #=> list all stations with abbreviations
# bart ORIG[:DEST[:DEST]] #=> show estimates for up to three origin stations
# Example:
# $ bart POWL:PITT:RICH:PHIL RICH:MLBR
# POWL=>PITT Pittsburg/Bay Point 10 min, 25 min, 40 min
@mwerner
mwerner / keybase.md
Created June 21, 2016 18:57
KeybaseIO

Keybase proof

I hereby claim:

  • I am mwerner on github.
  • I am mwerner (https://keybase.io/mwerner) on keybase.
  • I have a public key whose fingerprint is CE0B 68BD B57B E8BA C59C ECFF 3206 4AF5 4CF3 EC09

To claim this, I am signing this object:

@mwerner
mwerner / charge
Created November 2, 2015 20:06
script to show battery charge in your terminal
#!/usr/bin/env ruby
class Charge
attr_reader :state, :status
def initialize
@state, @status = `pmset -g batt`.split("\n")
end
def time_remaining
@time_remaining ||= begin
amount = status.match(/(\d+:\d+)/)[1]
~/code/sync-engine$ docker build -t sync-engine:1 .
Sending build context to Docker daemon 3.266 MB
Step 0 : FROM debian:wheezy
wheezy: Pulling from library/debian
b1d080d9151f: Pull complete
59a090c1706e: Pull complete
library/debian:wheezy: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
Digest: sha256:2986b2d73ce94f7f2065785cce74972506da22d49f0a1cd18662f553fbd09708
Status: Downloaded newer image for debian:wheezy
---> 59a090c1706e
@mwerner
mwerner / bart.rb
Last active August 29, 2015 14:21
BART predictions
#!/usr/bin/env ruby
%w(open-uri nokogiri).each{|library| require library }
class Bartleby
attr_reader :station, :key
ENDPOINT = 'http://api.bart.gov/api/etd.aspx'
def initialize(station, key)
@key = key
@mwerner
mwerner / open-all.js
Last active August 29, 2015 14:17
Open all Notifications
if ($('.mark-all-as-read').length) {
function openNotifications(source) {
var group = $(source).parents('.boxed-group');
var links = group.find('.js-notification-target');
links.attr('target', '_blank');
links.each(function(i, link){ $(link)[0].click(); });
}
var button = $('<span class="mark-all-as-read tooltipped tooltipped-e" aria-label="Open all notifications" style="cursor:pointer"> \