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 / 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.
if (typeof Object.create !== 'function') {
Object.create = function (o) {
var F = function() {};
F.prototype = o;
return new F();
};
}
var CarouselBase = function(){};
CarouselBase.prototype.cycle_interval = 15000;
@jeffmcfadden
jeffmcfadden / memcached gem fail
Created October 28, 2010 18:05
trying to build memcached on snow leopard
libtool: install: /usr/bin/install -c .libs/libmemcached.lai /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.la
libtool: install: /usr/bin/install -c .libs/libmemcached.a /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.a
libtool: install: chmod 644 /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.a
libtool: install: ranlib /Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib/libmemcached.a
----------------------------------------------------------------------
Libraries have been installed in:
/Users/jeffmcfadden/.rvm/gems/ruby-1.9.2-p0@rails3/gems/memcached-1.0.1/ext/lib
If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
@jeffmcfadden
jeffmcfadden / memcached gem fail full
Created October 28, 2010 18:07
Full build log of attempting to build memcached gem on snow leopard
Building native extensions. This could take a while...
ERROR: Error installing memcached:
ERROR: Failed to build gem native extension.
/Users/jeffmcfadden/.rvm/rubies/ruby-1.9.2-p0/bin/ruby extconf.rb
Building libmemcached.
tar xzf libmemcached-0.32.tar.gz 2>&1
Patching libmemcached source.
patch -p1 -Z < libmemcached.patch
patching file libmemcached-0.32/libmemcached/memcached_response.c
@jeffmcfadden
jeffmcfadden / Peter.rb
Created January 20, 2011 16:02
It's a Peter
class Peter
def isTired?
hadClassToday? && Time.now.hour > 22
end
def hadClassToday?
true unless ( Time.now.wday == 0 || Time.now.wday == 6 )
end
def status
@jeffmcfadden
jeffmcfadden / Jaconda2.js
Created January 28, 2011 04:31
Jaconda UserScript v2
// ==UserScript==
// @name growl-notifications
// @namespace http://fluidapp.com
// @description What does this do?
// @include *
// @author Someone
// ==/UserScript==
//Jquery:
/*!