Skip to content
View _atoms.sass
=def-classes($attr, $values...)
@each $val in $values
#{$attr}: #{$val}
@each $d in 0,1,2,4,8,16
@each $attr in margin, padding
.#{$attr}-#{$d}, .childs-#{$attr}-#{$d} > *
#{$attr}: #{$d}em
View Vertical Dividers between Columns.markdown
# nonlinear scrolling of idea attachments
# we want to make it like the scrolling pauses on each attachment
# for this we create an empty wrapper with the same width, height and use a fixed positioning for attachments container
# this way we can freely decide where to position them based on window's scroll position, and the wrapper will keep the
# preserved space in the document
$(window).on 'scroll', ->
container = $('.nonlinear-scroll')
wrapper = $('.nonlinear-scroll-wrapper')
breathePoints = $('.nonlinear-scroll-breathe-point')
View fui_boolean_input.rb
class FuiBooleanInput < SimpleForm::Inputs::BooleanInput
self.default_options = {:input_html => {'data-toggle' => "checkbox"}, :inline_label => true, :label => false}
def nested_boolean_style?
View 0_selector_hacks.scss
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }

An incomplete cheatsheet for rails 3. Things are added as they are required.

Active Record validations


class SomeClass < ActiveRecord::Base

  # length
View formtastic.rb
-> make form for all db columns
<%= semantic_form_for @user do |f| %>
<%= f.inputs %>
<%= f.buttons %>
<% end %>
-> select cols
<%= semantic_form_for @user do |f| %>
View all.rb
rails 1.9 new hash syntax
new_hash = {simon: "Talek", lorem: "Ipsum"}
View squeel
* KeyPaths
Person.joins(:articles => {:comments => :person}) => Person.joins(articles.comments.person)
-> they can also exist in the context of a hash
* Predicates
SQL Predication Operator Alias
= eq ==
Something went wrong with that request. Please try again.