Skip to content

Instantly share code, notes, and snippets.

View Syd's full-sized avatar

Scott Wisely Syd

View GitHub Profile
require 'open-uri'
require 'rubygems'
require 'hpricot'
require 'rss/maker'
content = RSS::Maker.make("2.0") do |feed|
feed.channel.title = "gamearena forums - enemy territory"
feed.channel.link = "http://www.gamearena.com.au"
feed.channel.description = "GA ET forums"
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url = open("http://steamcommunity.com/id/syd/friends")
doc = Nokogiri::HTML(url)
doc.xpath('//a[@class="linkFriend_online"]').each {|x| puts x.text}
/**
* dm_basics.sp
* Base CS:S DM admin/control functions.
* This file is part of CS:S DM, Copyright (C) 2005-2007 AlliedModders LLC
* by David "BAILOPAN" Anderson, http://www.bailopan.net/cssdm/
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
Adopt a section!
The Sinatra Book (http://github.com/cschneid/sinatra-book/tree/master) needs a little love.
I'm proposing a few of us adopt a small section of the book each to continue to contribute and maintain, particularly for the inevitable 1.0 release.
So, how do you help?
Contribute what you can to a section as well as check spelling, grammar, relevance, and correctness (do the given code and config examples still apply to the current release?). Build it, can it be formatted better? (lets not forget the PDF!).
Also remember to check the markdown is sane.
@Syd
Syd / gist:53721
Created January 28, 2009 00:05 — forked from sunny/gist:53587
require 'rubygems'
require 'sinatra'
get '/' do
haml :index
end
post '/' do
params[:upload][:tempfile].read
end
require 'rubygems'
require 'eventmachine'
module SimpleResponse
def receive_data data
if data =~ /^GET/
then
send_data "HTTP/1.1 200\nContent-type: text/plain\n\nHello World!"
close_connection_after_writing
else
syd@teh: sudo gem update --backtrace
Updating installed gems
ERROR: While executing gem ... (ArgumentError)
marshal data too short
/usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:209:in `load'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:209:in `load_specs'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:173:in `list'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:165:in `each'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:165:in `list'
/usr/local/lib/ruby/site_ruby/1.8/rubygems/spec_fetcher.rb:116:in `find_matching'
# Copyright 2009 Unbit S.a.s. <[email protected]>
# see the COPYRIGHT file
$stdout.sync = true
options = {}
if Process.uid == 0
puts "Never run uRack as root !!!"
exit
end