Skip to content

Instantly share code, notes, and snippets.

@davbre
davbre / rails_commands
Created January 28, 2012 07:51
rails commands
rails generate model Modelname attr1:string attr2:integer
rails destroy model Modelname
rails generate migration add_user_id_to_posts user_id:integer
/* Delete and re-create */
rake db:drop
rake db:create
rake db:migrate
rake db:reset
@davbre
davbre / gist:1966272
Created March 3, 2012 13:59
Rails Environment Ubuntu 11.10
Install rails
http://blog.sudobits.com/2011/10/27/how-to-install-ruby-on-rails-in-ubuntu-11-10/
Rubymine requires Java JDK:
http://superuser.com/questions/353983/how-do-i-install-the-sun-java-sdk-in-ubuntu-11-10-oneric
@davbre
davbre / gist:5266699
Created March 28, 2013 20:54
DataMapper save errors, inspection
DataMapper::Model.raise_on_save_failure = true
begin
[your_object_name].save
rescue DataMapper::SaveFailureError => e
puts e.resource.errors.inspect
end
@davbre
davbre / README.md
Created February 1, 2015 08:26
Declared Individual Donations All Donations 1997-2008

README is empty

@davbre
davbre / .htaccess
Last active August 29, 2015 14:16 — forked from andfinally/.htaccess
# html5 pushstate (history) support:
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !index
RewriteRule (.*) index.html [L,QSA]
</ifModule>
@davbre
davbre / _.md
Last active August 29, 2015 14:21
Tributary inlet
@davbre
davbre / _.md
Last active August 29, 2015 14:21
basics
@davbre
davbre / _.md
Last active August 29, 2015 14:21
basics1
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@davbre
davbre / index.html
Created May 29, 2015 12:23
Pluralsight D3 - basic charting // source http://jsbin.com/leregu
<!DOCTYPE html>
<html>
<head>
<script src="http://d3js.org/d3.v3.min.js"></script>
<meta charset="utf-8">
<title>Pluralsight D3 - basic charting</title>
</head>
<body>
<script id="jsbin-javascript">