Skip to content

Instantly share code, notes, and snippets.

View johnke's full-sized avatar

John Kelly johnke

View GitHub Profile
@johnke
johnke / mac_setup.sh
Last active November 28, 2023 19:19
A script to install most things I need to set up a new mac
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc. Based on
# Jeremy Seitz's osx-setup.sh
# https://gist.github.com/somebox/6b00f47451956c1af6b4
#
# Focused for Python/ops work
#
# Assumes you store your dotfiles in ~/Dropbox/Settings
#
@johnke
johnke / remind.py
Created February 3, 2017 10:43
A tool for weaponising the slack /remind command
#!/usr/bin/env python
import sys
import os
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
@johnke
johnke / .htaccess
Last active January 19, 2017 16:15
macdaraconroy.com .htaccess
RewriteEngine On
RewriteRule ^macro/(.*)\.html$ http://macdaraconroy.com/$1 [L,R=301]
# Testing on my local machine (using 'localhost' instead of macdaraconroy.com):
# $ vagrant@vagrant-ubuntu-trusty-64:/var/www/html$ curl localhost:80/macro/year/date/article_name_whatever.html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
# This will extract the top 250 films from the IMDb charts and output
# them as plain text for easy copy+pasting
import urllib2
from bs4 import BeautifulSoup
test_url = urllib2.urlopen('http://m.imdb.com/chart/top')
readHtml = test_url.read()
test_url.close()
soup = BeautifulSoup(readHtml, "lxml")
@johnke
johnke / keybase.md
Created September 25, 2014 08:48
Keybase Proof

Keybase proof

I hereby claim:

  • I am johnke on github.
  • I am johnke (https://keybase.io/johnke) on keybase.
  • I have a public key whose fingerprint is A63F 8CF5 E47D EC17 3A6C 140F F1DA 1510 67A1 9878

To claim this, I am signing this object:

@johnke
johnke / planter.rb
Created December 9, 2012 19:35 — forked from ttscoff/planter.rb
Create directory trees from indented text input
#!/usr/bin/ruby
# ruby script to create a directory structure from indented data.
# Three ways to use it:
# - Pipe indented (tabs or 2 spaces) text to the script
# - e.g. `cat "mytemplate" | planter.rb
# - Create template.tpl files in ~/.planter and call them by their base name
# - e.g. Create a text file in ~/.planter/site.tpl
# - `planter.rb site`
# - Call planter.rb without input and it will open your $EDITOR to create the tree on the fly
# You can put %%X%% variables into templates, where X is a number that corresponds to the index