Skip to content

Instantly share code, notes, and snippets.

View christiannaths's full-sized avatar
🍕
Eating pizza

Christian Naths christiannaths

🍕
Eating pizza
View GitHub Profile
begin
put_up_christmas_lights(:level => 2)
rescue fatal
safety = EmergencyResponse.new()
safety.deploy_safety_net
safety.call_paramedics
puts "HELP!"
end
@mixin sprite($url, $height: 100, $width: 100, $x: 0, $y: 0)
display: block
height: $height
width: $width
background: url($url)
background-position: ($x * $width) ($y * $height)
// used like so
// @include sprite($url: "images/sprite.png", $x: -3, $y: -1)
@christiannaths
christiannaths / _responsive.sass
Created October 17, 2012 22:02
Sass MQ Mixin
$narrow-device: "(max-width: 539px)" !default
$standard-device: "(min-width: 540px)" !default
$wide-device: "(min-width: 1200px)" !default
$retina-device: "(-webkit-min-device-pixel-ratio: 2), (min--moz-device-pixel-ratio: 2), (-o-min-device-pixel-ratio: 2/1), (min-device-pixel-ratio: 2), (min-resolution: 192dpi), (min-resolution: 2dppx)" !default
@mixin responds-to($device)
@if $device == wvp
@media #{ $wide-device }
@content
@christiannaths
christiannaths / typographic-scale.sass
Last active December 14, 2015 22:38
Typographic Scale Mixin
=set-type($base: 16px, $leading: 24px, $scale: 16px 18px 21px 24px 36px 48px)
body
font-size: percentage($base/16px)
h1
font-size: #{ nth($scale, 6) / $base }em
// TODO: figure out how to choose how many
// baseline grid spaces to use for line height
line-height: #{ ($leading * 2) / nth($scale, 6) }em
# Drops, re-creates and re-migrates the database
# Usage: rake db:remigrate
namespace :db do
desc "Raise an error unless development environment"
task :dev_only do
raise "You can only use this in dev!" unless Rails.env == 'development'
end
=font-face($family, $file, $weight: normal, $style: normal)
@font-face
font-family: $family
src: url("#{ $file }.eot")
src: url("#{ $file }.eot?#iefix") format("embedded-opentype"), url("#{ $file }.woff") format("woff"), url("#{ $file }.ttf") format("truetype"), url("#{ $file }.svg#svg#{ $family }") format("svg")
font-weight: $weight
font-style: $style
html{
background-image: linear-gradient(#0ff 1px, transparent 1px);
background-size: auto 1.5em;
}
@christiannaths
christiannaths / relative-baseline-grid-with-notes.css
Created February 2, 2015 19:01
Relative Baseline Grid Notes
body {
margin: 0;
/* Step 1: Choose a font-family */
font-family: Georgia, serif;
/* Step 2: Choose a font size */
font-size: 100%;
/* Step 3: Choose a line height (baseline grid unit) */
@christiannaths
christiannaths / moodle-custom-styles.css
Last active August 29, 2015 14:14
Moodle Custom Styles
.assignment {
font-family: Georgia;
font-size: 24px;
}
@christiannaths
christiannaths / rewalk-checkpoint-4.css
Last active August 29, 2015 14:16
rewalk-checkpoint-4
/* ------------------------------------------- helpers */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: rgba(0,0,0,0.1);
border: 1px solid rgba(0,0,0,0.1);
min-height: 3em;
}
.clearfix::after {