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
$(document).ready(function() { | |
var name = "dolphinhood"; | |
var apiKey = "B9enqZ1SESmqJ6NNbRuUcdj7nMDm9Vu8HI4zBhzsc7OLI5yZTz"; | |
// Boot up our TumblrMachine | |
var tumblr = new TumblrMachine(name, apiKey); | |
// Fetch the first set (20) of posts | |
tumblr.fetchPosts(function(posts) { | |
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
var data = { | |
"result": { | |
"lat": "40.693219", | |
"lng": "-73.989998", | |
"trains": [ | |
{ | |
"direction": 3, | |
"scheduled_track": "2", | |
"arrival_time": "2014-09-04T15:20:30-04:00", | |
"train_id": "02 1408 241/FLA", |
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
function gimmeDatJSON(callback) { | |
$.getJSON(geourl, function(response) { | |
callback(response); | |
}); | |
} | |
function processResponse(response) { | |
var lat = response.results[0].geometry.location.lat; | |
var lng = response.results[0].geometry.location.lng; | |
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
function signup(successCallback) { | |
$.ajax({ | |
url: 'http://signup.com', | |
type: 'post', | |
data: {username: "butt"}, | |
success: function(response) { | |
successCallback(response.user); | |
}, | |
error: function() { | |
alert('well...'); |
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
// API | |
function Wemo(devices) { | |
this.devices = devices; | |
this.baseURL = "http://localhost:5000/api/device/"; | |
this.state = {} | |
this.checked = 0; | |
this.resetState(); |
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
<div class="related-background"> | |
<div class="wrapper"> | |
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
{% comment %} | |
A snippet to include related products on a product single page. | |
More information: | |
- http://docs.shopify.com/support/your-store/products/can-i-recommend-related-products | |
{% endcomment %} | |
{% assign number_of_related_products_to_show = 4 %} |
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
var name = "reuters"; | |
var key = "2W5eRXOm7i0ZpdlEKi3g2G6wCAOJsTBpJ45aenzuNGikak9tl2" | |
t = new TumblrMachine(name, key, false, function(collection, isLast) { | |
var post = collection._posts[0].body; | |
var div = document.getElementsById('tumblr-post'); | |
body.innerHTML = post; | |
}); |
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
var key = "2W5eRXOm7i0ZpdlEKi3g2G6wCAOJsTBpJ45aenzuNGikak9tl2" | |
var name = "reuters" | |
t = new TumblrMachine(name, key, false, function(collection, isLast) { | |
var post = collection.posts()[0]; | |
var content = post.content(); | |
$('#photos').html(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
class func colorAtPercentage(color1: UIColor, color2: UIColor, perc: CGFloat) -> UIColor { | |
let firstComp = CGColorGetComponents(color1.CGColor) | |
let secondComp = CGColorGetComponents(color2.CGColor) | |
let red1 = firstComp[0] | |
let red2 = secondComp[0] | |
let newRed = numbers(red1, num2: red2, perc: perc) | |
let green1 = firstComp[1] |