Skip to content

Instantly share code, notes, and snippets.

@JohnColvin
JohnColvin / gist:e0a6e0e2b6f9c08c84e0
Last active May 10, 2024 14:59
Recommended browsers by platform and UAs for testing purposes
OS X
Recommendations:
10.7 and up:
Chrome (https://www.google.com/chrome/browser/desktop/index.html)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36
Firefox (http://getfirefox.com) 32 bit macs cannot run chrome, but can run FF
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:25.0) Gecko/20100101 Firefox/25.0
Safari 7, 8, or 9
@JohnColvin
JohnColvin / fizzbuzz
Created November 11, 2013 22:19
monkey patch fizz buzz
class Integer
def divisible_by?(i)
self%i === 0
end
def fizzbuzz
fizz + buzz
end
def fizz
@JohnColvin
JohnColvin / gist:5819888
Created June 20, 2013 02:30
Automatically rehash rbenv when installing a gem
gem-and-rehash() {
gem "$@"
if [ $1 ] && [ $1 = "install" ] ; then rbenv rehash ; fi
}
alias gem=gem-and-rehash
@JohnColvin
JohnColvin / gist:5785003
Last active December 18, 2015 12:48
Nexia Pro Team SSH Keys
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCz+jUmcILhyJTTzM9U6cYvSsy1ti4xsXCIQJz3c3c9mWQOw3+HaGsamOMNfXBSIp+nATBo6pzAp5JruiXDtOajZXZVeYxXW7rMHs6uCSNZbYUsKLQ/eRJkV/nosIjg8FtsBxxJ2xAs4ZuaTlA6R/HFUjJEf7FphwNQK0NOEWjEXcYcQ0sG15s4nlV8aOTiipto48vg4ktumUAD6GffRWqz/KTTjol9TdYkoVNsIbcHBZ1QmKmlb4OJVYSqn4ljCBhoZScZIyITw1CDTAgGRt0lLjVMPGY3lbhtD723XFKkih4jlV7+Z4/QD/s4SaOb4TS3et1UZPn8WshBIMjvy9SL [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCn6cdAHk2A4X8s63NYlkiC2ZBWtCUtIdpyHXg53DU2hMZyd2Fd7UgFRqcnYfV4jxkBMmxfUga3zYmR73AOKliaUDqX6t0HXy/DzABeHGWo4i0BW+c2bUBJ9Fu7tzSL+O1+iTj9rZVl+ZZ8naQq7wAETjNFl0hpfQdsv7kq37LAF8AoBui7oQLTJ/24/HtnZ2QTJ2wlqlPVLPASYlPSq6tPIseEmO7xOoJVqFLZsyuYMOhWUkUYIn9or1yZSfuSZA+6snEFaV6/wG+A8+4O0g39BPM+rVnY6t2rQEbd9uvAuPNOVzpVc2pMjqskql29d9+r8qeMudK0nvQ9klFg1vTX [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCvss2FDmj529SaFXe/6ynbkzpGcXTKllS8WblQ84LCVgCaWctUBwIT2Y5aCR+EWhwrRhpdKNTpgYZ30T2fOg8uXA+a7NHV5nUyixvVoqdUzkRFzGG08OpqIsYimbowbY8iZmFaJoZ+kjytvOYJU5LVzeVl2
@JohnColvin
JohnColvin / gist:5454219
Last active May 10, 2024 15:02
A "pick and choose" method for using fontello icons in rails

Initial installation and rails-ification of fontello assets

Make a fonts asset dir

cd to your rails app and mkdir app/assets/fonts

Choose your icons and download them

  • Browse to fontello.com
  • Choose your fontello icons
  • Click 'Download webfont'
@JohnColvin
JohnColvin / gist:3899616
Created October 16, 2012 14:31
Integrate shibboleth into a rails app

How to integrate shibboleth into a rails application

This assumes that shibboleth is installed on the server running the rails application. It should be possible to use SAML to authenticate by shibboleth without installing it on the server.

add to Gemfile

gem 'omniauth-shibboleth' and then bundle

create 'config/initializers/omniauth.rb'

In this example, the user id field is the employee number provided by shibboleth

Rails.application.config.middleware.use OmniAuth::Builder do