Skip to content

Instantly share code, notes, and snippets.

@deplorableword
deplorableword / lighthouse-export.rb
Created January 31, 2011 12:22
sudo gem install ticketmaster, sudo gem install ticketmaster-lighthouse. usage: ruby lighthoust-export.rb accoutname username password projectid
require 'rubygems'
require 'ticketmaster'
require 'ticketmaster-lighthouse'
Lighthouse.account = ARGV[0]
Lighthouse.authenticate(ARGV[1],ARGV[2])
all_tickets = Lighthouse::Ticket.find(:all, :params => { :project_id => ARGV[3] })
begin
File.delete("export.html")
@deplorableword
deplorableword / .htaccess
Created January 28, 2011 15:56
Allow wordpress uploads though HTTP basic authentication
# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
Satisfy Any
Order allow,deny
Allow from all
Deny from none
</FilesMatch>
@deplorableword
deplorableword / config.ru
Created January 16, 2011 15:14
How to run a Jeykll site on Heroku with Sinatra
require 'devart'
run Sinatra::Application
import sys
import getopt
import telnetlib
import re
class Varnish:
def __init__(self, agentConfig, checksLogger, rawConfig):
self.agentConfig = agentConfig
self.checksLogger = checksLogger
self.rawConfig = rawConfig
@deplorableword
deplorableword / varnish.rb
Created October 20, 2010 08:53
Install varnish 2.0.6 via Brew on Snow Leopard
require 'formula'
class Varnish <Formula
url 'http://downloads.sourceforge.net/project/varnish/varnish/2.0.6/varnish-2.0.6.tar.gz'
homepage 'http://varnish.projects.linpro.no/'
md5 'd91dc21c636db61c69b5e8f061c5bb95'
depends_on 'pkg-config' => :build
depends_on 'pcre'
sub vcl_recv {
if (req.url == "/something") {
unset req.http.Accept-Encoding;
}
}
Balla:zeitgeist tom$ ruby scripts/smq bridge --input twitter_sample
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : start processing: twitter_sample => bridge => stdio
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : name: bridge_twitter_sample_to_stdio
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : input config: twitter_sample
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : output config: stdio
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : input queue name: twitter.sample
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : output queue name:
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : json params: {}
[bridge_twitter_sample_to_stdio] 2010-09-28 22:35:43 - INFO : parsed params: {}
{:output_queue=>
<?php
$cm->debug_level = 1;
print_r($cm);
require 'rubygems'
require 'nokogiri'
require 'open-uri'
doc = Nokogiri::HTML(open('http://www.vodkaemporium.com/gin/gin.php'))
product_list = doc.css("#mainContent tr")
product_list.each do |product|
product_title = product.css('a strong')
.clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
.clearfix{ display: inline-table; }
.clearfix{ display: block; }