Skip to content

Instantly share code, notes, and snippets.

View etagwerker's full-sized avatar
🏠
Working from home

Ernesto Tagwerker etagwerker

🏠
Working from home
View GitHub Profile
@etagwerker
etagwerker / first-phase-world-cup-games.json
Created June 5, 2014 02:08
first-phase-world-cup-games.json
[{"group": "A", "number": "1", "time": "Thu Jun/12/14 17:00","local": "Brazil", "visitor": "Croatia", "city": "Arena de São Paulo, São Paulo", "timezone": "UTC-3"},
{"group": "A", "number": "2", "time": "Fri Jun/13/14 13:00","local": "Mexico", "visitor": "Cameroon", "city": "Estádio das Dunas, Natal", "timezone": "UTC-3"},
{"group": "A", "number": "17", "time": "Tue Jun/17/14 16:00","local": "Brazil", "visitor": "Mexico", "city": "Estádio Castelão, Fortaleza", "timezone": "UTC-3"},
{"group": "A", "number": "18", "time": "Wed Jun/18/14 18:00","local": "Cameroon", "visitor": "Croatia", "city": "Arena Amazônia, Manaus", "timezone": "UTC-4"},
{"group": "A", "number": "33", "time": "Mon Jun/23/14 17:00","local": "Cameroon", "visitor": "Brazil", "city": "Brasília", "timezone": "UTC-3"},
{"group": "A", "number": "34", "time": "Mon Jun/23/14 17:00","local": "Croatia", "visitor": "Mexico", "city": "Recife", "timezone": "UTC-3"},
{"group": "B", "number": "3", "time": "Fri Jun/13/14 16:00","local": "Spain", "visitor": "
module Topsy
..
# Returns list of authors that talk about the query. The list is sorted by frequency of posts and the influence of authors.
#
# @param [String] q the search query string
# @param [Hash] options method options
# @option options [String] :window Time window for results. (default: 'a') Options: auto - automatically pick the most recent and relevant window. h last hour, d last day, w last week, m last month, a all time
# @option options [Integer] :page page number of the result set. (default: 1, max: 10)
namespace :db do
desc "drops, creates, migrates and seeds the database"
task :reload do
Rake::Task["db:drop"].invoke
Rake::Task["db:create"].invoke
Rake::Task["db:migrate"].invoke
Rake::Task["db:seed"].invoke
end
after :update_code do
# ...
if uses_whenever
if "cron_node".eql? current_node # is there a current_node variable in capistrano or something like that?
run "cd #{current_release} && whenever --update-crontab #{application}"
sudo "chmod 775 #{current_release}/script/runner"
end
class Admin::PicturesController < ApplicationController
layout 'admin'
admin_assistant_for Picture do |admin|
admin.index do |index|
index.columns :image
index[:image].image_size = "75x75"
end
end
end
/*
Correction for step #5 of http://pusherapp.com/docs/quickstart
Where it says:
*/
server.bind('thing-create', function(thing) {
alert('A thing was created: '+ thing.name);
};)
/* It should say: */
*filter
# Allows all loopback (lo0) traffic and drop all traffic to 127/8 that doesn't use lo0
-A INPUT -i lo -j ACCEPT
-A INPUT ! -i lo -d 127.0.0.0/8 -j REJECT
# Accepts all established inbound connections
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
window.onload = function () {
var raphael = Raphael("holder");
raphael.g.txtattr.font = "12px 'Trebuchet MS','Trebuchet','Verdana','sans-serif'";
raphael.g.text(210, 20, "User Activity").attr({"font-size": 16});
var pie = raphael.g.piechart(260, 180, 90, [55, 20, 13], {legend: ["Active", "Inactive", "Recently Inactive"], legendpos: "west", href: ["http://google.com", "http://etagwerker.com", "http://github.com"]});
pie.hover(function () {
this.sector.stop();
this.sector.scale(1.1, 1.1, this.cx, this.cy);
var bars_data = new google.visualization.DataTable();
bars_data.addColumn('string', 'Month');
bars_data.addColumn('number', 'Average response %');
bars_data.addRows(6);
bars_data.setValue(0, 0, 'March');
bars_data.setValue(0, 1, 0);
bars_data.setValue(1, 0, 'April');
bars_data.setValue(1, 1, 3);
bars_data.setValue(2, 0, 'May');
[etagwerker@gesell topsy]$ cat topsy.gemspec
require File.expand_path("../lib/topsy/version", __FILE__)
Gem::Specification.new do |s|
s.name = %q{topsy}
s.version = Topsy::VERSION
s.platform = Gem::Platform::RUBY
s.required_rubygems_version = ">= 1.3.6"
s.authors = ["Wynn Netherland", "Ernesto Tagwerker"]
s.date = %q{2010-09-28}