Skip to content

Instantly share code, notes, and snippets.

View jeffmcfadden's full-sized avatar

Jeff McFadden jeffmcfadden

View GitHub Profile
@jeffmcfadden
jeffmcfadden / update_ip_addresses.rb
Created July 1, 2014 15:16
DNS Made Easy Dyanmic DNS Update Script
#!/usr/bin/env ruby
require 'open-uri'
require "net/http"
require "uri"
# Change this
username = "fancypants"
# Set these up
@jeffmcfadden
jeffmcfadden / IPCameraView.swift
Created July 2, 2014 22:48
A UIView Subclass For Displaying An IPCamera Stream (MJPEG)
class IPCameraView: UIView, NSURLSessionDataDelegate {
var imageView:UIImageView
var url: NSURL
var endMarkerData: NSData
var receivedData: NSMutableData
var dataTask: NSURLSessionDataTask
init(frame: CGRect) {
@jeffmcfadden
jeffmcfadden / geodesic.php
Created September 16, 2014 22:37
Geodesic Distance in PHP
function HowFar( $p1, $p2 ){
// WGS-84 Ellipsoid
$a = 6378137;
$b = 6356752.3142;
$f = 1/289.257223563;
$L = $p2->GetLong() - $p1->GetLong();
$U1 = atan( ( 1 - $f ) * tan( $p1->GetLat() ) );
$U2 = atan( ( 1 - $f ) * tan( $p2->GetLat() ) );
@jeffmcfadden
jeffmcfadden / esv_book_data.m
Last active August 29, 2015 14:06
ESV Data in ObjC Usable Formats
NSArray *books_and_chapters = @{@"Genesis" : @"50",
@"Exodus" : @"40",
@"Leviticus" : @"27",
@"Numbers" : @"36",
@"Deuteronomy" : @"34",
@"Joshua" : @"24",
@"Judges" : @"21",
@"Ruth" : @"4",
@"1 Samuel" : @"31",
@"2 Samuel" : @"24",
MORSE_CODE_DICTIONARY = {
"a" => ".-",
"b" => "-...",
"c" => "-.-.",
"d" => "-..",
"e" => ".",
"f" => "..-.",
"g" => "--.",
"h" => "....",
"i" => "..",
#!/usr/bin/env ruby -E utf-8
# merge_asana_into_omnifocus.rb
# Hilton Lipschitz
# http://www.hiltmon.com
# Use and modify freely, attribution appreciated
# Script to import Asana projects and their tasks into
# OmniFocus and keep them up to date from Asana.
#!/usr/bin/env ruby
require 'optparse'
require 'yaml'
require 'time'
require 'date'
PHOTOS_DIR = "/Users/yourname/yoursite/_assets/images/photos"
POSTS_DIR = "/Users/yourname/yoursite/_posts"
---
layout: default
---
<div class="photo-post">
<div class="photo-post-photo">
<a href="{% asset_path "photos/{{page.photo_lg}}" %}"><img class="img" src="{% asset_path "photos/{{page.photo_sm}}" %}" /></a>
</div>
<div class="photo-post-caption">
<p class="desc">{{page.exif_desc}}</p>

Keybase proof

I hereby claim:

  • I am jeffmcfadden on github.
  • I am jeffmcfadden (https://keybase.io/jeffmcfadden) on keybase.
  • I have a public key ASB9qWgaupRgFMNBq21ZVJvMwmiY0sKmSBx3Sm7YvD51fAo

To claim this, I am signing this object:

require 'watir'
browser = Watir::Browser.new
while true do
begin
browser.goto "http://www.radiotimes.com/news/2017-07-21/radio-times-radio-and-podcast-champion-round-4-5"
sleep 1
puts "Clicking Brady Haran"
browser.radio(name: "PDI_answer9793268", value: "44802685" ).set