citizen428.blog()

Try to learn something about everything

Information Overload 2011-12-18

An entrepreneur can have the most brilliant idea in the world and plenty of funding to develop and sell it, but if customers can’t afford to buy the company’s products, the entrepreneur and his or her investors won’t create a single permanent job.

Das ist der wichtigste Sieg der Finanzindustrie: dass sie selbst nie auf Gipfeln erscheinen muss, dort aber Regie zu führen versucht, und dass ihre Kriterien bei der Bewertung der dort erzielten Ergebnisse als die vernünftigen gelten.

Information Overload 2011-12-11

As Alan Kay, a major pioneer of today’s software-eaten planet, pointed out recently, the Internet doesn’t have stop, shut down, or rewind buttons. Once it was turned on, history was essentially rebooted.

The progression is the same everywhere: first the people ask, then they demand, then they come and they take.

Viennale 2011

From the “better late than never” department, here’s a quick writeup of the movies I saw this year.

  • Ha-shoter: The story of a member of an Israeli anti-terror unit and a group of young radicals. This had a lot of potential, but all in all it was a very disappointing experience. I don’t know what it was, but neither the actors nor the storytelling convinced me in any way.
  • The Future: Miranda July’s second feature length film was my personal highlight of this years Viennale. It was witty, thoughtful and also very sad at times and has the same quirkiness that made “Me and You and Everyone We Know” such an excellent movie.
  • Schlafkrankheit: The story of a German aid worker in Africa. This was neither particularly good, nor was it awful. Not a bad movie, but if you never see it, you won’t miss much.

Information Overload 2011-12-04

Quite often, the answer to that exasperated “why don’t they just … ?” is green, and it folds.

There was a lot of talk about ‘convergence’ in the run-up to Greece joining the euro, as if swapping a weak currency for a strong one would magically turn a corrupt, nepotistic economy of olive groves and tourist beaches into a transparent, meritocratic Bavaria-on-the-Aegean.

Information Overload 2011-11-27

Die Reaktion der Politik ist die übliche, nämlich die, sich selber zu helfen.

Your brain doesn’t like randomness, and so it tries to connect a cause to every effect; when it can’t, you make one up.

Ruby GitHub Projects Atom Feed

The other day I found an interesting post by Lisper extraordinaire Zach Beane on Planet Lisp, where he describes his program to generate a feed for the GitHub page about recently created Common Lisp repos.

Since good artists borrow and great artists steal, I decided to do the latter with his idea and implemented something similar for the new Ruby repos. It uses open-uri for fetching the page, Nokogiri for parsing it and Builder for generating the Atom feed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
require 'open-uri'
require 'nokogiri'
require 'builder'

html = open("https://github.com/languages/Ruby/created")
doc = Nokogiri::HTML.parse(html)

atom = Builder::XmlMarkup.new(:target => STDOUT, :indent => 2)
atom.instruct!
atom.feed "xmlns" => "http://www.w3.org/2005/Atom" do
  atom.id "urn:citizen428:github:newrepos"
  atom.updated Time.now.utc.iso8601(0)
  atom.title "New GitHub Ruby Repos", :type => "text"
  atom.link :rel => "self", :href => "/ruby_github.atom"
  doc.xpath("//table[@class='repo']/tr/td[@class='title']/a").each do |title|
    name = title.content
    owner = title.at_xpath("../../td[@class='owner']/a").content
    desc = title.at_xpath("../../following-sibling::tr/td[@class='desc']").content
    date = Time.parse(title.at_xpath("../../td[@class='date']").content)
    atom.entry do
      atom.title "#{owner}: #{name}"
      atom.author { atom.name owner }
      atom.link "href" => "https://github.com#{title.attributes["href"].value}"
      atom.id "urn:citizen428:github:#{owner}:#{name}"
      atom.published date.utc.iso8601(0)
      atom.updated date.utc.iso8601(0)
      atom.content desc, :type => "html"
    end
  end
end

I’m hosting the feed on this blog (updated regularly via cron), add it to your feed reader to discover potentially interesting new Ruby projects.

A Little Pow Helper

If you are a Ruby developer on MacOS X, you probably love Pow as much as I do. While skimming the fine manual today, I noticed section 3.2, “Reading the Current Configuration”, which explains that you can query Pow’s config and status via simple HTTP requests:

Query Pow’s statusPow manual
1
curl -H host:pow localhost/status.json

Since I know I’d probably forget that sooner than later, I immediately wrapped it up in a small script, which I called pow-show and put in ~/bin:

~/bin/pow-show
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env ruby

require 'json'

unless %w(status config).include?(ARGV[0])
  puts "Usage: #{File.basename($0)} status|config"
  exit 1
end

jj JSON.parse(`curl -s -H host:pow localhost/#{ARGV[0]}.json`)

Here’s some example output:

pow-show status
1
2
3
4
5
{
  "pid": 802,
  "version": "0.3.2",
  "requestCount": 134
}
pow-show config
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
  "bin": "/Users/name/Library/Application Support/Pow/Versions/0.3.2/bin/pow",
  "dstPort": 80,
  "httpPort": 20559,
  "dnsPort": 20560,
  "timeout": 900,
  "workers": 2,
  "domains": [
    "dev"
  ],
  "extDomains": [

  ],
  "hostRoot": "/Users/name/Library/Application Support/Pow/Hosts",
  "logRoot": "/Users/name/Library/Logs/Pow",
  "rvmPath": "/Users/name/.rvm/scripts/rvm"
}

Maybe that’s useful for someone else too.

Information Overload 2011-11-20

Information Overload 2011-11-13

[…] Iran has as much chance of stopping an Israeli strike as Prime Minister Benjamin Netanyahu does of becoming an ayatollah […]

We’re from Shanghai. We care only about money. You want to talk politics, go to Beijing.

Information Overload 2011-11-06