Skip to content

Instantly share code, notes, and snippets.

Avatar

David Kelly opensourceame

View GitHub Profile
@opensourceame
opensourceame / import_zone_to_hover.rb
Created Dec 22, 2020
Import a DNS zone file into hover.com
View import_zone_to_hover.rb
#!/usr/bin/env ruby
# import am DNS zone file into Hover
#
# first get your domain ID from here:
# https://www.hover.com/api/domains/yourdomain.com/dns/
#
# install the required gems:
#
# gem install hover dns-zone
@opensourceame
opensourceame / redis-cli-aliases.sh
Created Jun 9, 2020
Useful redis command line aliases - e.g. delete keys using a wildcard / pattern
View redis-cli-aliases.sh
#!/bin/sh
#
# usage: redis-del-keys these:ones:*
redis-del-keys() {
redis-cli --scan --pattern $1 | xargs redis-cli del
}
@opensourceame
opensourceame / application.rb
Created Apr 21, 2020
fix to make Rails 4 work with Postgres gem > 0.20.0
View application.rb
# fix to make Rails 4 work with Postgres gem > 0.20.0
#
# place this in your config/application.rb just after the Bundler.require() line
module Kernel
def gem_with_pg_fix(dep, *reqs)
if dep == "pg" && reqs == ["~> 0.15"]
reqs = ["~> 1.0"]
end
gem_without_pg_fix(dep, *reqs)
end
View gist:24f43ccc42a47d246931fbcd84afa668
# output the fibonacci series to n in the series
#
def fibonacci(n, last = 1, previous = 0)
puts previous
current = last + previous
return if n == 0