Skip to content

Instantly share code, notes, and snippets.

$scroll-shadow-background: rgb(255, 255, 255) !default;
$scroll-shadow-color: rgb(0, 0, 0) !default;
$scroll-shadow-intensity: 0.15 !default;
$scroll-shadow-cover: 40px !default;
$scroll-shadow-size: 14px !default;
@mixin scroll-shadow-vertical($background-color: $scroll-shadow-background, $shadow-intensity: $scroll-shadow-intensity, $shadow-color: $scroll-shadow-color, $cover-size: $scroll-shadow-cover, $shadow-size: $scroll-shadow-size) {
background-image:
// Shadow covers
linear-gradient($background-color 30%, rgba($background-color,0)),
@cristianferrarig
cristianferrarig / isRetina.css
Last active December 15, 2015 05:19
Media Query for high pixel ratio devices // iPhone 4, Opera Mobile 11 and others
@media
only screen and (-webkit-min-device-pixel-ratio: 1.5),
only screen and (-o-min-device-pixel-ratio: 3/2),
only screen and (min--moz-device-pixel-ratio: 1.5),
only screen and (min-device-pixel-ratio: 1.5) {
// Styles
}
@sporkd
sporkd / question.rb
Created February 15, 2012 23:33
Using arel matches_any
class Question < ActiveRecord::Base
# UGLY
def self.starts_with(*strings)
# Big loop to build something like this...
where("wording LIKE ? OR wording LIKE ? OR wording LIKE ?", 'blah%', 'blaah%', 'blaaah%')
end
# PURDY
def self.starts_with(*strings)
strings = strings.map { |s| s+'%' }
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')