Skip to content

Instantly share code, notes, and snippets.

@ryangreenberg
ryangreenberg / README Iterator requires key.md
Last active March 19, 2019 17:32
hhvm Iterator requires key

Iterator appears to require implementation of $key although it is not defined in the interface.

Version

hhvm --version
HipHop VM 4.0.3 (rel)
Compiler: 1551382911_N
Repo schema: 738e610628295bb89d752ed238c444f9687b1b67
@ryangreenberg
ryangreenberg / Gemfile
Last active October 11, 2018 16:41
Simple Rack server to show incoming requests
# frozen_string_literal: true
source "https://rubygems.org"
gem "rack"
@ryangreenberg
ryangreenberg / commit-msg
Created July 20, 2018 20:06
Tool for generating commit messages your coworkers are guaranteed to love
#!/usr/bin/env ruby
puts DATA.readlines.sample.strip
# From http://macintoshphone.blogspot.com/p/list-of-apple-ic-slogans.html
__END__
iThink, therefore iMac.
Hello. Again.
Blows minds, not budgets.
Where did the computer go?
@ryangreenberg
ryangreenberg / generate uuids.md
Created July 16, 2018 15:56
Generate UUID in various languages

Python

python -c 'import uuid; print(uuid.uuid4())'

Ruby

ruby -r securerandom -e 'puts SecureRandom.uuid'
Homebrew build logs for hhvm/hhvm/[email protected] on macOS 10.13.3
Build date: 2018-03-20 16:14:51
Homebrew build logs for slack/slack/[email protected] on macOS 10.13.3
Build date: 2018-03-20 15:35:21
@ryangreenberg
ryangreenberg / homebrew —> cask-core
Created November 15, 2017 17:26
install_homebrew, script to install packages on a new machine (extracted from private dotfiles)
1password
divvy
dropbox
google-chrome
nvalt
screenflow
skitch
spotify
sublime-text
@ryangreenberg
ryangreenberg / dnd.sh
Created October 24, 2017 22:40
Do Not Disturb
#!/bin/bash
set -eou pipefail
# From https://heyfocus.com/enabling-do-not-disturb-mode and
# https://apple.stackexchange.com/questions/145487
if [[ $(defaults -currentHost read ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb) -eq 0 ]]; then
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "`date -u +\"%Y-%m-%d %H:%M:%S +000\"`"
@ryangreenberg
ryangreenberg / overview.md
Created October 3, 2017 17:52
Rack middleware, Finagle Filter, etc.
request         response
  |                 Λ
+-|-----------------|--+
| |   MIDDLEWARE 1  |  |
+-|-----------------|--+
| |   MIDDLEWARE 2  |  |
+-|-----------------|--+
| V   APPLICATION   |  |
+----------------------+
american avocet
american coot
american crow
american goldfinch
american kestrel
american redstart
american robin
anna's hummingbird
bald eagle
barn swallow