Skip to content

Instantly share code, notes, and snippets.

View holman's full-sized avatar

Zach Holman holman

View GitHub Profile
@holman
holman / omnicas.rb
Created February 3, 2011 00:05
CAS and OmniAuth
require 'rubygems'
require 'sinatra'
require 'net/https'
require 'omniauth/enterprise'
use OmniAuth::Builder do
provider :CAS, :cas_server => "http://localhost:8080/cas-server-webapp-3.4.5"
end
enable :sessions
@holman
holman / SAFE-RUBY.rb
Created February 16, 2011 05:38
This shows some of my favorite ways to ensure robust, high-security Ruby Applications.
require 'net/https'
module SecurityModule
class HighSecurity
class ReallyHighSecurity
def self.turn_on_safe_connections
OpenSSL::SSL::VERIFY_NONE
end
end
end
puts "YOU ARE NOW SECURE USING RUBY™"
@holman
holman / output
Created March 14, 2011 10:00
vagrant a vagrant your vagrant
vagrant@vagrantup:/go-deeper$ sudo vagrant up
[default] Provisioning enabled with chef_solo...
[default] Importing base box 'centos'...
[default] Matching MAC address for NAT networking...
[default] Running any VM customizations...
[default] Clearing any previously set forwarded ports...
[default] Forwarding ports...
[default] -- ssh: 22 => 2222 (adapter 1)
[default] Creating shared folders metadata...
[default] Booting VM...
ruby-1.8.7-p334 in zach/
› gem update --system 2
Updating rubygems-update
Fetching: rubygems-update-1.7.0.gem (100%)
Successfully installed rubygems-update-1.7.0
Installing RubyGems 1.7.0
./lib/rubygems.rb:31:in `require': no such file to load -- rubygems/deprecate (LoadError)
from ./lib/rubygems.rb:31
from setup.rb:24:in `require'
from setup.rb:24

So I sent this to the company:

and then there was this:

@holman
holman / cray.md
Created October 15, 2012 19:37
Dropbox is cray

Hi Zach,

We’re working to make it easier for your Dropbox for Teams administrators to manage all the stuff you and your teammates have in your Teams account. Soon, we’ll be releasing new features for admins to manage the security of your team’s stuff and make it easier for them to help when things go wrong.

In some cases, your admin may need the flexibility to take some actions on your Teams account, such as helping to manage shared folders or restoring access if you get locked out of your account. In order to clarify that admins may have access to team member accounts when managing the team, we're updating our Dropbox for Teams Agreement and Privacy Policy.

You might have some personal files in your Teams account that you’d like to move to a personal account. For example, if you want to keep vacation pictures in a different account from your latest Excel spreadsheet, you can use this online guide to move your files:

View the new agreement and get started here

@holman
holman / jekyll_media_length.rb
Created October 19, 2015 01:18
Drop the length of a particular audio file and junk into your Jekyll page.
# jekyll_media_length / by @holman
#
# Drop the length of a particular audio file and junk into your Jekyll page.
# (See https://twitter.com/Una/status/655856628198014976 for more context).
#
# INSTALL:
#
# brew install taglib
# gem install taglib-ruby
#
@holman
holman / mpd.rb
Last active February 21, 2016 05:21
A forumula for mpd that maybe won't crash all the time on m4a files on OS X. Currently on https://github.com/mxcl/homebrew/pull/19368/files, waiting to be merged upstream.
require 'formula'
class Mpd < Formula
homepage 'http://www.musicpd.org/'
url 'http://www.musicpd.org/download/mpd/0.17/mpd-0.17.4.tar.bz2'
sha1 'e3a16b5d784c3699b151e72cfa58d0ea54a49b13'
head "git://git.musicpd.org/master/mpd.git"
@holman
holman / Guthrie IP.md
Last active August 4, 2016 03:30
Woody Guthrie, on intellectual property.

This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years, and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don’t give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that’s all we wanted to do.

  • Woody Guthrie, 1940's —