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
li { | |
cursor: pointer; | |
display: inline; | |
font-size: 14px; | |
} | |
li:after { | |
content: "/"; | |
margin: 0 10px; | |
color: #d33; | |
} |
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
backgroundNoise: function() { | |
// Fancy noisy background with canvas | |
if (!!!document.createElement('canvas').getContext) { | |
return; | |
} | |
var canvas = document.createElement("canvas"); | |
canvas.width = 100; | |
canvas.height = 100; | |
var ctx = canvas.getContext("2d"); | |
var x, y; |
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
_.each(data,function(model) { | |
$('<li/>') | |
.data('lat',model.latitude) | |
.data('long',model.longitude) | |
.data('name',model.name) | |
.data('address',model.address) | |
.appendTo('ul#locations'); | |
}); |
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
// declare our global googlemap helper | |
googlemap = { | |
infowindows: [], | |
dropMarker: function() { } | |
}; | |
window.googlemap = googlemap; |
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
$('#locations li').each(function() { | |
googlemap.dropMarker($(this)); | |
}); |
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
googlemap.dropMarker = function($element) { | |
var myLatlng = new google.maps.LatLng($element.data('lat'),$element.data('long')), | |
marker = new google.maps.Marker({ | |
position: myLatlng, | |
map: map, | |
title: $element.data('name') | |
}), | |
infowindow = new google.maps.InfoWindow({ | |
content: $element.data('name') + '<br/>' + $element.data('address') | |
}); |
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
replaceWord: -> | |
text = $( '#textarea' ).val().split(' ') | |
word = text[text.length-2] | |
index = text.length - 2 | |
ajax = | |
url: 'http://words.bighugelabs.com/api/2/d60ba0946e7215aa09a94b94a20b4bbf/' + word + '/json' | |
type: 'GET' | |
dataType: 'jsonp' | |
success: ( data ) -> | |
text = $( '#textarea' ).val().split(' ') |
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
replaceWord: -> | |
text = $( '#textarea' ).val().split(' ') | |
word = text[text.length-2] | |
index = text.length - 2 | |
ajax = | |
url: 'http://words.bighugelabs.com/api/2/d60ba0946e7215aa09a94b94a20b4bbf/' + word + '/json' | |
type: 'GET' | |
dataType: 'jsonp' | |
success: ( data ) -> | |
text = $( '#textarea' ).val().split(' ') |
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
queue.subscribe do |payload| | |
begin | |
language = AlchemyApi::LanguageDetection.get_language_from_text(payload.force_encoding("UTF-8"))[:language] | |
rescue | |
end | |
p language | |
end |
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
queue.subscribe do |payload| | |
begin | |
language = AlchemyApi::LanguageDetection.get_language_from_text(payload.force_encoding("UTF-8"))[:language] | |
rescue | |
end | |
p language | |
end |