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
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
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
background-image: -webkit-radial-gradient(50% 50%, circle closest-side, #2249e1 0%, #1d1e5e 100%); | |
background-image: radial-gradient(50% 50%, circle closest-side, #2249e1 0%, #1d1e5e 100%); |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
// We'll want the controller to become the scrollView's delegate | |
// in order to respond to changes in the content offset position. | |
shelfScrollView.delegate = self; | |
// We'll generate an array of image views to serve as the shelf | |
// background. These shelves will reposition as they scroll out | |
// of the viewport. |
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
- (void)imagePickerController:(UIImagePickerController *)picker | |
didFinishPickingMediaWithInfo:(NSDictionary *)info { | |
// Hide the image picker. | |
[picker dismissModalViewControllerAnimated:YES]; | |
// Reference the image from the picker. | |
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage]; | |
// Use the size of the image to calculate its aspect ratio. | |
float aspectRatio = image.size.width/image.size.height; |
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> | |
<head> | |
<style type="text/css" media="screen"> | |
.pressed { | |
background: #f00; | |
} | |
.js-dropDown { | |
display: none; |
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
<!-- Form Container Start --> | |
<div class="form-container"> | |
<% if params[:key].nil? %> | |
<%= direct_upload_form_for @uploader, html: {:class => "form"} do |f| %> | |
<p class="field"> | |
<label>Select a photo to upload:</label><br> | |
<%= f.file_field :image %> | |
</p> | |
<p class="field"> |
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
Started POST "/admin/photos/7/approve" for 199.223.122.34 at 2013-10-29 20:46:18 +0000 | |
2013-10-29T20:46:18.589054+00:00 app[web.1]: Processing by Admin::PhotosController#approve as */* | |
2013-10-29T20:46:18.589054+00:00 app[web.1]: Parameters: {"id"=>"7"} | |
2013-10-29T20:46:18.598598+00:00 app[web.1]: Photo Load (4.2ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = $1 LIMIT 1 [["id", "7"]] | |
2013-10-29T20:46:18.603564+00:00 app[web.1]: (4.6ms) BEGIN | |
2013-10-29T20:46:18.610299+00:00 app[web.1]: Photo Load (3.8ms) SELECT "photos".* FROM "photos" WHERE "photos"."id" = $1 LIMIT 1 [["id", 7]] | |
2013-10-29T20:46:18.613560+00:00 app[web.1]: (2.3ms) UPDATE "photos" SET "approved" = 't', "image" = '0289da71-14cd-46c1-a42c-feff92ac0303/Screen%2520Shot%25202013%252010%252029%2520at%25201.44.20%2520PM.png', "updated_at" = '2013-10-29 20:46:18.610428' WHERE "photos"."id" = 7 |
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
// | |
// Get direction | |
// | |
this.getDirectionFromBearing = function(bearing) { | |
if (bearing > 330 || bearing <= 15) { | |
return "N"; | |
} else if (bearing > 15 || bearing <= 60) { | |
return "NE"; | |
} else if (bearing > 60 || bearing <= 105) { | |
return "E"; |