#Rails
####Generate a controller and action
rails generate controller <controller name> <action>
####Change layout for entire Controller
class ProductsController < ApplicationController
layout "inventory"
| // | |
| // toggleLaunchAtStartup.swift | |
| // Recents | |
| // | |
| // Created by Phil LaPier on 5/21/15. | |
| // Copyright (c) 2015 Philip LaPier. All rights reserved. | |
| // | |
| // With help from: https://github.com/RamonGilabert/Prodam/blob/master/Prodam/Prodam/LaunchStarter.swift | |
| import Foundation |
| // ---- | |
| // Sass (v3.3.4) | |
| // Compass (v1.0.0.alpha.18) | |
| // Bourbon (v) | |
| // ---- | |
| @import "bourbon/bourbon"; | |
| body{ | |
| @include transition (all 2.0s ease-in-out); |
| <div>foobar</div> |
| $ = jQuery | |
| class Modal | |
| @ESC_KEY_CODE: 27 | |
| constructor: (@modal) -> | |
| @_addDialogBackground() | |
| @_listenForDialogDismiss() | |
| show: -> |
| #!/usr/bin/env ruby | |
| require 'tempfile' | |
| file = Tempfile.new(['js2coffee', '.js']) | |
| file.write ARGF.read # write vim selection to tmp file | |
| file.rewind | |
| file.close | |
| puts `js2coffee #{file.path}` # requires js2coffee | |
| file.unlink # deletes the temp file |
| @mixin ellipsis ($max-width){ | |
| display: inline-block; | |
| max-width: $max-width; | |
| overflow: hidden; | |
| text-overflow: ellipsis; | |
| white-space: nowrap; | |
| } |
| // Fadein | |
| //************************************************************************// | |
| %animation-fadein { | |
| @include animation(fadein 0.1s); | |
| } | |
| @mixin fadein { | |
| 0% { | |
| opacity: 0; | |
| } | |
| 100% { |
| @mixin my-linear-gradient($color1, $color2) { | |
| filter: progid:DXImageTransform.Microsoft.gradient(gradientType=0, startColorstr='#{$color1}', endColorstr='#{$color1}'); | |
| @include linear-gradient($color1, $color2); // Bourbon.io linear-gradient | |
| } | |
| // Usage | |
| @include my-linear-gradient(red, orange); |
#Rails
####Generate a controller and action
rails generate controller <controller name> <action>
####Change layout for entire Controller
class ProductsController < ApplicationController
layout "inventory"
| Sass Mixin for typekit variation-specific font-family names | |
| Typekit IE6-8 Support (http://help.typekit.com/customer/portal/articles/6855-Using-multiple-weights-and-styles) | |
| $lucida-grande: "Lucida Grande", Tahoma, Verdana, Arial, sans-serif; | |
| $georgia: Georgia, Cambria, "Times New Roman", Times, serif; | |
| // Must include fallbacks for EACH typekit font — set them each as variables | |
| //************************************************************************// | |
| $typekit-fonts: "source-sans-pro", "ff-tisa-web-pro"; // index [1, 2] |