This file contains 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
#!/usr/bin/env ruby | |
# -*- ruby -*- | |
# twitter command line client | |
# That's What I Call Lame | |
# 09nov2008 +chris+ | |
require 'json' | |
require 'open-uri' |
This file contains 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
%w[hpricot json open-uri].each{|lib| require(lib) } | |
class Feed | |
def self.parse(uri) | |
doc = Hpricot.XML(open(uri)) | |
feed = new(uri) | |
if doc.at(:item) | |
feed.parse_rss2(doc) | |
elsif doc.at(:entry) |
This file contains 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
✈ | |
This file contains 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
module Base62 | |
CHARS = ('a'..'z').to_a + ('A'..'Z').to_a + ('0'..'9').to_a | |
MOD = CHARS.size # 62 | |
module_function | |
def encode_packed(string) | |
encode(string.unpack('H*').at(0).to_i(16)) | |
end | |
This file contains 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
CmdUtils.CreateCommand({ | |
name: "selfmark", | |
homepage: "http://manveru.net", | |
author: { name: "Michael Fellinger", email: "[email protected]"}, | |
contributors: ["Michael Fellinger"], | |
license: "MIT", | |
description: "Tags the current site using selfmarks", | |
icon: "http://sm.purepistos.net/favicon.ico", | |
help: "Save the current url to selfmarks with the tags input by the user. Any selected text on the page will be recorded as the note.", |
This file contains 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
def by_loop | |
loop do | |
break if yield | |
end | |
end | |
def by_while | |
while true | |
break if yield | |
end |
This file contains 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
require 'spec/helper' | |
require 'innate/helper/cgi' | |
require 'heckle' | |
module Bacon | |
class HeckleRunner | |
def initialize(filter, heckle_class = Heckler) | |
@filter, @heckle_class = filter, heckle_class | |
end |
This file contains 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
With this code, CPU usage shoots to 100% when serving the index page. | |
% gem19 list -l | |
*** LOCAL GEMS *** | |
daemons (1.0.10) | |
diakonos (0.8.7) |
This file contains 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
require 'open-uri' | |
require 'hpricot' | |
user, project = ARGV # 'tobi', 'liquid' | |
fail "get-github-wiki <username> <projectname>" unless user and project | |
uri = "http://wiki.github.com/#{user}/#{project}" | |
xpath = "div.sidebar/ul[1]//a" | |
command = %w[wget -t 2 -mkc --no-parent] |
This file contains 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
#!/usr/bin/env ruby | |
# Small CLI tool to make adding selfmarks easier. | |
# | |
# @see http://sm.purepistos.net | |
options = {'host' => 'http://sm.purepistos.net/uri/add_window_add'} | |
key_file = File.expand_path("~/.config/sm.key") | |
require 'optparse' |
OlderNewer