Skip to content

Instantly share code, notes, and snippets.

li {
cursor: pointer;
display: inline;
font-size: 14px;
}
li:after {
content: "/";
margin: 0 10px;
color: #d33;
}
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;
_.each(data,function(model) {
$('<li/>')
.data('lat',model.latitude)
.data('long',model.longitude)
.data('name',model.name)
.data('address',model.address)
.appendTo('ul#locations');
});
// declare our global googlemap helper
googlemap = {
infowindows: [],
dropMarker: function() { }
};
window.googlemap = googlemap;
$('#locations li').each(function() {
googlemap.dropMarker($(this));
});
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')
});
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(' ')
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(' ')
  queue.subscribe do |payload|
    begin
    language = AlchemyApi::LanguageDetection.get_language_from_text(payload.force_encoding("UTF-8"))[:language]
    rescue
    end
    p language
  end
queue.subscribe do |payload|
begin
   language = AlchemyApi::LanguageDetection.get_language_from_text(payload.force_encoding("UTF-8"))[:language]
  rescue
  end
  p language
end