Skip to content

Instantly share code, notes, and snippets.

View danielres's full-sized avatar

Daniel Reszka danielres

  • Pixarea studio
  • Germany
View GitHub Profile
@danielres
danielres / CSS3 notes.css
Created November 26, 2010 12:30
quick notes for CSS3 cross-browser declarations
div {
-moz-box-shadow: black 1px 1px 15px 0;
-webkit-box-shadow: black 1px 1px 15px 0;
-o-box-shadow: black 1px 1px 15px 0;
box-shadow: black 1px 1px 15px 0;
}
div {
-moz-border-radius: 10px;
# source: http://tech.patientslikeme.com/2010/05/12/manage-your-css3-tricks-with-sass-mixins/
# complete mixin:
=box_gradient(!top,!bottom)
background-image = “-moz-linear-gradient(top, #{!top}, #{!bottom})”
background-image = “-webkit-gradient(linear,left top,left bottom,color-stop(0, #{!top}),color-stop(1, #{!bottom}))”
-ms-filter = “progid:DXImageTransform.Microsoft.gradient(startColorStr=’#{!top}’, EndColorStr=’#{!bottom}’)”
# isolated:
=box_gradient_ie67(!top,!bottom)
@danielres
danielres / controller.rb
Created November 10, 2010 23:41
how to have checkboxes in the view for a many-to-many relationship
# in controller:
def update
# (.....)
@categories = Category.all
checked_categories = []
checked_params = params[:category_list] || []
@danielres
danielres / .htaccess
Created November 7, 2010 22:30
generate a functionnal rails application on alwaysdata
# General Apache options
AddHandler fcgid-script .fcgi
AddHandler cgi-script .cgi
Options +FollowSymLinks +ExecCGI
# If you don't want Rails to look in certain directories,
# use the following rewrite rules so that Apache won't rewrite certain requests
#
# Example:
# RewriteCond %{REQUEST_URI} ^/notrails.*
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Pixarea XHTML Transitional boilerplate</title>
<meta name="title" content="" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
@danielres
danielres / SCSS mixin: two-columns.scss
Created November 7, 2010 16:26
COMPASS/SCSS mixin for 2 column CSS layout
@mixin two-columns($prop1, $prop2, $col1 = '.main', $col2 = '.sub'){
$totalwidth : $prop1 + $prop2;
#{$col1} {
@include column(ceil($blueprint-grid-columns * $prop1 / $totalwidth ));
}
#{$col2} {
@include column(floor( $blueprint-grid-columns * (1 - $prop1/($prop1 + $prop2))), true);
}
}