This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.
To capture the video (filesize: 19MB), using the free "QuickTime Player" application:
#!/usr/bin/env ruby | |
require 'net/telnet' | |
cache_dump_limit = 100 | |
localhost = Net::Telnet::new("Host" => "localhost", "Port" => 11211, "Timeout" => 3) | |
slab_ids = [] | |
localhost.cmd("String" => "stats items", "Match" => /^END/) do |c| | |
matches = c.scan(/STAT items:(\d+):/) | |
slab_ids = matches.flatten.uniq | |
end |
"I am a freelance Ruby and Rails developer". When I talk with my geek friends, everyone understands what I do and they have a reasonable understanding of how I spend my day. But sometimes, less technical people ask me what I do for a living and then I tend to dumb down the answer: "I am a programmer, I usually build websites.". Oh -they say- my nephew also make websites, he even built me a blog in Blogger.
Err... yes, but that hardly has anything to do with what I do for a living.
There are many different kinds of websites, built with different technologies, and depending on the site and the technology used to build it, they are made by one kind of professional or another. The craft of building a website comprises many different disciplines, and professionals usually specialize in just one part of the process. Although I do many different things, my specialization is mainly programming dynamic websites using Ruby and Rails.
In this article I want to
I think the austerity measures imposed by Europe to Spain will eventually work. But the only possible outcome I personally expect is to get back to where we were before the crisis. An illusion of wealth just waiting for the next crisis to happen.
Politicians seem to have decided that this crisis won't change anything. Probably because the first thing that needs to change are the politicians themselves.
After this crisis, Spain will be as inefficient and as brittle as it was before. Spain economy will keep depending on the state, on the banks and on a few very big companies to survive. We will keep depending on our King closing big deals with Arab Sheiks while hunting elephants in Africa.
The banks and the big companies, knowing that the consequences of their errors will be assumed by the tax-payers, as they cannot afford to let them down, will keep becoming increasingly more inefficient and incompetent.
require 'rubygems' | |
gem 'twitter' | |
gem 'geocoder' | |
class Hash | |
def to_url_params | |
elements = [] | |
keys.size.times do |i| | |
elements << "#{keys[i]}=#{values[i]}" |
#!/usr/bin/env ruby | |
files = %w{aol015 aol026}.map{|f| f+".sessionized"} | |
sessions = {} | |
#load sessions hash | |
files.each do |f| | |
lines = File.open(f).each do |line| | |
if line.length > 10 | |
sid, uid, q, *rest = line.split("\t") | |
if sessions.has_key? sid |
%% | |
%% wait_for_stream/2 | |
%% | |
wait_for_stream({xmlstreamstart, _Name, Attrs}, StateData) -> | |
?TRACE(undefined, "START: ~p", [Attrs]), | |
DefaultLang = case ?MYLANG of | |
undefined -> " xml:lang='en'"; | |
DL -> " xml:lang='" ++ DL ++ "'" | |
end, | |
case xml:get_attr_s("xmlns:stream", Attrs) of |
private static void sort(int start, int end, long[] array) { | |
long temp; | |
int length = end - start; | |
if (length < 7) { | |
for (int i = start + 1; i < end; i++) { | |
for (int j = i; j > start && array[j - 1] > array[j]; j--) { | |
temp = array[j]; | |
array[j] = array[j - 1]; | |
array[j - 1] = temp; | |
} |