Skip to content

Instantly share code, notes, and snippets.

@ruedap
ruedap / SassMeister-input-HTML.haml
Created January 27, 2015 06:09
Generated by SassMeister.com.
.block
.block__element foo
.is--responsive
.block
.block__element bar
html {
font-family: sans-serif;
}
html {
-ms-text-size-adjust: 100%;
}
html {
-webkit-text-size-adjust: 100%;
@ruedap
ruedap / gist:af5647f29bba99abfa9d
Last active August 29, 2015 14:12
Sass for media queries
$mq-min-width-mobile: null;
$mq-min-width-tablet: 768px;
$mq-min-width-desktop: 992px;
$mq-min-breakpoints: (
mobile: $mq-min-width-mobile,
tablet: $mq-min-width-tablet,
desktop: $mq-min-width-desktop
);
@ruedap
ruedap / SassMeister-input-HTML.haml
Last active August 29, 2015 14:10
Generated by SassMeister.com.
%ul.List
%li.List-item.List-item--active 1
%li.List-item 2
%li.List-item 3
@ruedap
ruedap / switch-button.png
Last active August 29, 2015 14:09
Switch Button CSS
.switch-button
.switch-button__button.is-active Type A
.switch-button__button Type B
.switch-button__button Type C
@ruedap
ruedap / gist:fb404d8cf8d2d4cc5775
Last active August 29, 2015 14:07
CSS3 custom radio button
input[type=radio] {
display: none;
& + label {
position: relative;
padding-left: 24px;
cursor: pointer;
&::before,
&::after {
@ruedap
ruedap / D3Example.js.coffee
Created April 28, 2014 16:21
D3Example class
class D3Example
constructor: (@selector, width, height, @margin, hasBorder) ->
@margin = top: 20, right: 20, bottom: 20, left: 20 unless @margin
@el = @defineRootElement(@selector, +width, +height, @margin, hasBorder)
defineRootElement: (selector, width, height, margin, hasBorder) =>
@width = width - margin.left - margin.right
@height = height - margin.top - margin.bottom
d3.select(selector)
@ruedap
ruedap / untitled.rb
Last active August 29, 2015 13:59
Convert to .jpg from .png using RMagick
require 'pathname'
require 'rmagick'
images = Dir['*.png']
images.each {|image| i = Magick::Image.read(image).first; i.write(Pathname(image).sub_ext('.jpg')) { self.format='JPEG'; self.quality=80; }}
@ruedap
ruedap / test.js.coffee
Last active August 29, 2015 13:59
D3 example: basic bar chart with frame border
class D3Example
constructor: (@selector, width, height, @margin) ->
@el = @defineRootElement(@selector, +width, +height, @margin)
defineRootElement: (selector, width, height, margin) =>
@width = width - margin.left - margin.right
@height = height - margin.top - margin.bottom
d3.select(selector)
.append('svg')
.attr('width', width)
@ruedap
ruedap / test.js.coffee
Created April 11, 2014 12:50
D3 example: basic bar chart
class D3Example
constructor: (@selector, width, height, @margin) ->
@el = @defineRootElement(@selector, +width, +height, @margin)
defineRootElement: (selector, width, height, margin) =>
@width = width - margin.left - margin.right
@height = height - margin.top - margin.bottom
d3.select(selector)
.append('svg')
.attr('width', width)