This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# USAGE | |
# | |
# > clone chriseppstein/compass | |
# | |
# Cloning into 'compass'... | |
githubclone() { | |
git clone [email protected]:$1.git; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define (require) -> | |
$ = require 'jquery' | |
_ = require 'underscore' | |
Backbone = require 'backbone' | |
Handlebars = require 'handlebars' | |
View = require 'lib/view' | |
startTemplate = require 'text!templates/start.html' | |
class StartView extends View |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getRandomColor: -> | |
number = Math.floor(Math.random() * (3 - 1 + 1)) + 1 | |
switch number | |
when 1 then "#983a30" | |
when 2 then "#187598" | |
# why not | |
getRandomColor: -> ["#983a30", "#187598"][Math.ceil(Math.random() * 3)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Coffeescript + Underscore syntactic sugar makes this so gracefully concise. | |
# | |
class LinkValidation | |
constructor: -> | |
@VALID_SERVICES = [ | |
"flickr.com\/photos\/[a-z0-9_-]+\/(\d+)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Based on Chris' post here: https://gist.github.com/3828790 | |
@mixin respond-to($size) { | |
// Small | |
@if $size == "small" { | |
@media only screen and (min-width: 320px) { | |
@content; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Bear in mind: this is NOT a way to address | |
* issues with bandwidth and sending large | |
* images to a mobile browser. | |
* | |
* For a great discussion of that, check out this A List Apart | |
* article by Dave Rupert: http://bit.ly/QGfJk4 | |
* | |
* The media query is based on the snippet recently posted by Chris | |
* Coyier on CSS Tricks: http://bit.ly/QGg71V |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
This is a simple way to constrain an index to a range. A good use case for this is | |
selecting DOM elements and then getting the element on a given index in that selection. | |
The code in getIndexInSelection() will constrain the index to the range of elements available, | |
choosing either the highest or lowest index if the requested index is out of range. | |
--> | |
<div id="container"> | |
<section>...</section> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Our theme base. | |
* | |
* We shouldn't have to modify this to create a new theme. | |
*/ | |
@import 'compass/css3/images'; | |
$page-fill: #f1f1f1 !default; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Odd or Even | |
&:nth-child(even/odd) { } | |
// Every third item | |
&:nth-child(3n) {} | |
// Every third item, starting with the first | |
&:nth-child(3n-5) { } | |
// Every fourth item |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<!--[if IE 7]><html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]--> | |
<!--[if IE 8]><html class="no-js lt-ie9" lang="en"> <![endif]--> | |
<!--[if gt IE 8]><!--><html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<title>Example</title> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<meta name="viewport" content="width=device-width"> |