Skip to content

Instantly share code, notes, and snippets.

View drewhamlett's full-sized avatar
Verified

Drew Hamlett drewhamlett

Verified
  • Untappd
  • Wilmington, NC
View GitHub Profile
@lloeki
lloeki / foo_controller.rb
Created May 29, 2012 07:05
Streaming (CSV) data in Rails 3.2
class FooController
respond_to :csv
def index
@foos = Foo.scoped
if stale?(:last_modified => Foo.something)
respond_with @gta do |format|
format.csv { stream_csv @foo }
end
end
@seanaedmiston
seanaedmiston / devise.rb
Created August 21, 2011 10:53
Devise Omniauthable
...
# ==> Configuration for any authentication mechanism
# Configure which keys are used when authenticating a user. The default is
# just :email. You can configure it to use [:username, :subdomain], so for
# authenticating a user, both parameters are required. Remember that those
# parameters are used only when authenticating and not when retrieving from
# session. If you need permissions, you should implement that in a before filter.
# You can also supply a hash where the value is a boolean determining whether
# or not authentication should be aborted when the value is not present.
config.authentication_keys = [ :login ]
@mundhradevang
mundhradevang / index.html
Created June 5, 2011 04:08 — forked from mbostock/.block
Treemap in D3/SVG with zooming capability
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Treemap</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.layout.js"></script>
<style type="text/css">
rect {