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
do ($ = jQuery) -> | |
methods = | |
split_at_colon: (points) -> | |
points.split(":") | |
split_at_comma: (points) -> | |
if typeof points == "object" | |
for mini_array in points | |
for num in mini_array.split(",") | |
parseInt(num) | |
else |
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
%tbody | |
- albums.each do |album| | |
- artist = album.artist | |
- if artist == player | |
%tr.highlight{:class => cycle("odd", "even")} | |
- else | |
%tr{:class => cycle("odd", "even")} | |
%td | |
%td | |
%td |
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
[~]$ java -Xmx1024M -Xms1024M -jar minecraft_server.jar?v=1314101698550 nogui | |
151 recipes | |
16 achievements | |
2011-08-23 08:18:18 [INFO] Starting minecraft server version Beta 1.7.3 | |
2011-08-23 08:18:18 [INFO] Loading properties | |
2011-08-23 08:18:18 [INFO] Starting Minecraft server on *:25565 | |
2011-08-23 08:18:18 [INFO] Preparing level "world" | |
java.io.EOFException | |
at java.util.zip.GZIPInputStream.readUByte(GZIPInputStream.java:249) | |
at java.util.zip.GZIPInputStream.readUShort(GZIPInputStream.java:239) |
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_total = (trend, duration) -> | |
total = 0 | |
for keyword in trend.search_terms | |
url = "http://otter.topsy.com/search.json?q=#{keyword}&window=#{duration}" | |
$.when( $.getJSON(url) ).then((data) -> | |
total += data.response.total | |
) | |
console.log total | |
total |
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() { | |
var build_chart, build_pie_chart, current, fade_duration, get_total; | |
window.trends = {}; | |
current = {}; | |
fade_duration = 200; | |
$(function() { | |
return build_pie_chart("d"); | |
}); | |
build_chart = function(chart_type) {}; | |
build_pie_chart = function(duration) { |
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
x = [1, 2, 3] | |
y = [2, 1, 1] | |
x.each_with_index |elem, index| do | |
x[index] = elem + y[index] | |
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
// create an array of terms from an array of objects | |
for item in trend.search_terms | |
search_terms.push(item.term) | |
// while a part of the array is left | |
while search_terms.length > 0 | |
// create a mini array of 7 items | |
for num in [0..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_each(trends.islam, 1, (trend) -> | |
console.log trend | |
) | |
get_each = (trend, duration, callback) -> | |
requests = [] | |
for term in trend.search_terms | |
url = "http://otter.topsy.com/search.js?callback=?&apikey=X&q=#{term.term}&window=#{duration}" |
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
default_chart_options = function() { | |
return { | |
chart: { | |
renderTo: "chart", | |
defaultSeriesType: 'pie' | |
}, | |
xAxis: { | |
categories: [] | |
}, | |
credits: { |
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
trends.justin = | |
call: "justin" | |
title: "Justin Bieber" | |
search_terms: [{term: 'justin bieber'}, {term: 'bieber'}] | |
trends.christian = | |
call: "christian" | |
title: "Christianaity" | |
search_terms: [{term: 'christianaity'}, | |
{term: 'christian'}, |