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
if Modernizr.touch and @article? and @touchTarget? |
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
constructor: (params={}) -> | |
# Store the href for reference. We'll need it for history.pushState. | |
@href = params["href"] | |
# Create a temp element to store and parse the response content. | |
tempElement = document.createElement("div") | |
tempElement.innerHTML = params['html'] | |
# Grab and assign the article. | |
if params['element']? |
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
touchEnd: (event) -> | |
limit = window.innerWidth/3 | |
if @slideTo > 0 and Math.abs(@slideTo) >= limit | |
@moveTo(window.innerWidth) | |
else if @slideTo < 0 and Math.abs(@slideTo) >= limit | |
@moveTo(-window.innerWidth) | |
else | |
@moveTo(0) |
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> | |
<html class="mediaqueries"> | |
<head> | |
<style type="text/css" media="screen" src="..."></style> | |
</head> | |
<body> | |
... | |
<a href="#" id="mediaToggle">View the full site.</a> | |
</body> | |
</html> |
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
group :development, :test do | |
gem 'rspec-rails' # Use rspec to do our integration tests. | |
gem 'factory_girl_rails' # Factory girls makes it easy to mock objects for our tests. | |
gem 'capybara' # Capybara lets us drive our integration tests via headless browser. | |
gem 'launchy' # Launchy let's us launch the current state of the app in the browser if we need to diagnose. | |
gem 'database_cleaner' # Necessary for undoing transactions in the database during our integration tests. | |
gem 'sqlite3' | |
gem 'evergreen', :require => 'evergreen/rails' | |
gem 'rb-fsevent', :require => false if RUBY_PLATFORM =~ /darwin/i | |
gem 'guard-rspec' |
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
class @Animator | |
@generate: (params={}) -> | |
animation = "@-#{Animator.prefix()}-keyframes #{params["name"]} {" | |
for keyframe, rules of params["keyframes"] | |
animation += "#{keyframe} {" | |
for property,value of rules | |
animation += "#{property.replace("prefix",Animator.prefix())}: #{value};" | |
animation += "}" | |
animation += "}" | |
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
/** | |
* CSS3 Gradient Pixel/Percentage Mix-n-Match Example | |
*/ | |
background: #f06; | |
background: linear-gradient(left, #f00 10px, #444 20px, #3465a4 21px, #203388 10rem, #204a87 100%); | |
min-height:100%; | |
background: #426fa9; |
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
$.ajax({ | |
url: url | |
data: | |
cuepoints: @player.cuepoints | |
type: "POST" | |
dataType: "json" | |
error: (jqXHR, textStatus, errorThrown) => | |
@player.errorFlashMessage.html("There was a problem saving the cuepoint data at this time.") | |
@player.container.addClass(@player.errorClass) | |
@removeSpinner() |
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
@mixin rounded($side, $radius: 10px) { | |
border-#{$side}-radius: $radius; | |
-moz-border-radius-#{$side}: $radius; | |
-webkit-border-#{$side}-radius: $radius; | |
} | |
@mixin round($radius: 10px) { | |
border-radius: $radius; | |
-moz-border-radius: $radius; | |
-webkit-border-radius: $radius; |
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
# To use this script run: | |
curl -O https://raw.github.com/gist/1395181/d9147fd2aa0ca24ec609c188438d1eec60f8ffb4/bootstrap.sh; chmod +x bootstrap.sh; sudo ./bootstrap.sh | |
# Also the script assumes a group with admin privileges | |
# called admin already exists. If it does not you may want | |
# to check by running visudo: | |
# | |
# Create sudo group: | |
# (may not be necessary LTS now has admin group by default) | |
visudo |