Skip to content

Instantly share code, notes, and snippets.

View austinbv's full-sized avatar
🎯
Focusing

Austin austinbv

🎯
Focusing
View GitHub Profile
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
%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
[~]$ 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)
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
(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) {
x = [1, 2, 3]
y = [2, 1, 1]
x.each_with_index |elem, index| do
x[index] = elem + y[index]
// 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]
$ ->
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}"
default_chart_options = function() {
return {
chart: {
renderTo: "chart",
defaultSeriesType: 'pie'
},
xAxis: {
categories: []
},
credits: {
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'},