Skip to content

Instantly share code, notes, and snippets.

View holman's full-sized avatar

Zach Holman holman

View GitHub Profile
@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

So I sent this to the company:

and then there was this:

@holman
holman / gemspec-usage.md
Created February 12, 2012 07:02
test/spec/mini

Just install this in your apps like so:

gem 'test-spec-mini', :git => 'git://gist.github.com/1806986.git', :require => 'mini'

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
@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...
@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 / 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
# Hitting
http://otter.topsy.com/trackbacks.js?callback=jsonp1272404811434&url=http%3A%2F%2Fzachholman.com%2F2010%2F04%2Fapple-is-petrified%2F&perpage=50
# Returns this JSON with only one result:
jsonp1272404811434({"request":{"parameters":{"url":"http://zachholman.com/2010/04/apple-is-petrified/","perpage":"50"},"response_type":"js","resource":"trackbacks","url":"http://button.topsy.com/trackbacks.js?perpage=50&url=http%3A%2F%2Fzachholman.com%2F2010%2F04%2Fapple-is-petrified%2F"},"response":{"page":1,"topsy_trackback_url":"http://topsy.com/tb/zachholman.com/2010/04/apple-is-petrified/","total":1,"perpage":50,"list":[{"permalink_url":"http://twitter.com/alexanderkahn/status/12966881983","date":1272404753,"content":"RT @holman: Why Apple (probably) won't fix iTunes:\n\nhttp://zachholman.com/2010/04/apple-is-petrified","date_alpha":"58 seconds ago","author":{"name":"Alex Kahn","url":"http://twitter.com/alexanderkahn","topsy_author_url":"http://topsy.com/twitter/alexanderkahn","photo_url":"http://a3.twimg.c
named_scope :with_city, lambda {|city| city.present? ? {:conditions => {:city => city} : {}}
Search.with_city('Pittsburgh').size # => 2
Search.with_city(nil).size # => all