Skip to content

Instantly share code, notes, and snippets.

Working on

Ben Woodward benwoodward

Working on
View GitHub Profile
benwoodward /
Created Feb 26, 2020
Mac/Zsh-only: List new files recursively by date created within current directory. Displays relative dates.
relative-date() {
while read input_string; do
local file_path=`echo $input_string | cut -d ' ' -f 5`
local ls_date=`echo $input_string | cut -d ' ' -f 1,2,3,4`
# Accepts date in format found in `ls` output, and converts to epoch
local date="$(date -j -f "%d %b %H:%M:%S %Y" "$ls_date" +"%s")"
local now="$(date +"%s")"
local time_diff=$((now - date))
if ((time_diff > 24*60*60)); then
benwoodward / unclap.rb
Last active Jun 23, 2018
Script to unclap/unrecommend all stories on Medium
View unclap.rb
require 'rubygems'
require 'selenium-webdriver'
class Unclap
USERNAME = "@yourusername"
def initialize
@driver = Selenium::WebDriver.for :chrome
@links_to_unclap = []
@problem_links = []
benwoodward / # macvim - 2016-04-19_09-57-26.txt
Created Apr 19, 2016
macvim on Mac OS X 10.11.3 - Homebrew build logs
View # macvim - 2016-04-19_09-57-26.txt
Homebrew build logs for macvim on Mac OS X 10.11.3
Build date: 2016-04-19 09:57:26
benwoodward / do_end.sublime-snippet
Created Oct 12, 2014
Sublime Text Snippet for simple "do ... end", because typing do+enter annoyingly activates the 'dob' (do |variable| .. end) snippet, which is not always what you want.
View do_end.sublime-snippet
<description>do … end</description>

Keybase proof

I hereby claim:

  • I am benwoodward on github.
  • I am benwoodward ( on keybase.
  • I have a public key whose fingerprint is 8CB4 B3A3 55DC D852 72E0 CF5B DC0B 197A B188 0BE3

To claim this, I am signing this object:

benwoodward / haml_data-attributes.haml
Created Aug 12, 2014
How to convert html 5 data attributes in haml to html
View haml_data-attributes.haml
%table.table.table-bordered.table-striped#sortable{:data => {update_url:

SASS Modules


  • modularity
  • encapsulation
  • predictability
  • extensibility
  • integrability
  • explicitness
View .gitconfig
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
tool = Kaleidoscope
prompt = false
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustExitCode = true
View overrides.rb
class ActiveAdmin::Views::Pages::Base < Arbre::HTML::Document
def build_page_content
div :id => "active_admin_content", :class => (skip_sidebar? ? "without_sidebar" : "with_sidebar") do
build_sidebar unless skip_sidebar?
benwoodward /
Created Mar 1, 2013
Create a new role in postgres
createuser -s -U $USER