Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

CSS global clear in SASS



html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, 
p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, 
dfn, em, font, img, ins, kbd, q, s, samp, small, strike, strong, sub, 
sup, tt, var, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, 
table, caption, tbody, tfoot, thead, tr, th, td
  :margin 0
  :padding 0
  :border 0
  :outline 0
  :font-weight inherit
  :font-style inherit
  :font-size 100%
  :font-family inherit
  :vertical-align baseline
  :background transparent

Default merb datamapper database.yml file


:development: &defaults
  :adapter: mysql
  :database: modeler
  :username: root
  :password: 
  :host: localhost

:test:
  <<: *defaults
  :database: sample_test

:production:
  <<: *defaults
  :database: sample_production

:rake:
  <<: *defaults

ActiveRecord reconnect to database

// my Merb consoles drop the db connection after the mysql timeout; I'd rather not reload the whole environment

ActiveRecord::Base.connection.reconnect!