Skip to content

Instantly share code, notes, and snippets.

@hungrysquirrel
hungrysquirrel / Field.js
Created July 12, 2017 04:12
Style Storybook with Styled Components
import React, { PropTypes } from 'react';
import styled from 'styled-components'
const Field = ({
children,
label,
name,
}) => (
<div className="test">
<label className="test" htmlFor={name}>{label}</label>
def saved_search_image_with_attributes
property_image = saved_search_property.album.best_first_image_for_size(560, 320)
width = property_image.respond_to?(:width) ? property_image.width : 320
width_for_display = width > 0 ? width : 320
''.tap { |out|
out << content_tag(:a, :href => "#{auto_login_url}", :style =>"display: block;text-decoration: none; height: auto; :width => '#{width_for_display}';") do
"#{display_updated_attributes_for(saved_search_property)}"
end
}.html_safe
@hungrysquirrel
hungrysquirrel / Copy CSS Dimensions.jsf
Created February 14, 2011 04:51
Corrects the odd formatting of height and width when pasted into text editor
/*
------------------------------------
Copy CSS Dimensions v1.0
------------------------------------
Created by Matt Stow 2010
http://www.mattstow.com
------------------------------------
*/
(function()