Skip to content

Commit

Permalink
some new bins
Browse files Browse the repository at this point in the history
  • Loading branch information
DVG committed Dec 29, 2015
1 parent 7dae210 commit 9fa6ec9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
21 changes: 21 additions & 0 deletions bin/apple-pencil
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env ruby

# Script to check BestBuy.com for Apple Pencil Stock.

require 'terminal-notifier'
def notify(message, options={title: nil})
TerminalNotifier.notify(message, title: options[:title])
end

require 'watir-webdriver'
browser = Watir::Browser.new :phantomjs

browser.goto "http://www.bestbuy.com/site/apple-apple-pencil-for-ipad-pro-white/4538802.p?id=1219764052206&skuId=4538802"

cart_button = browser.div(class: 'cart-button')

if cart_button.text != "Sold Out Online"
notify "Check bestbuy.com to buy", title: 'Apple Pencil Available'
end

browser.close
8 changes: 8 additions & 0 deletions bin/reset-one-password
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/sh
#
# Resets one password trial by blowing away the sqlite database

echo '=================> Clobbering 1Password Trial'
rm ~/Library/Application\ Support/1Password\ 4/Data/OnePassword.sqlite
echo '=================> Done!'
echo 'See you in 30 days'
1 change: 1 addition & 0 deletions tmux/aliases.zsh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
alias terminal-notifier='reattach-to-user-namespace terminal-notifier'

0 comments on commit 9fa6ec9

Please sign in to comment.