Skip to content

Instantly share code, notes, and snippets.

View ezodude's full-sized avatar
🪡
Making agentic apps work

Ezo Saleh ezodude

🪡
Making agentic apps work
View GitHub Profile
@retr0h
retr0h / gist:1001477
Created May 31, 2011 23:14
RVM + HomeBrew + Nokogiri
BREW_HOME=$HOME/.homebrew
$ brew install libxml2
$ brew link libxml2
$ brew install https://github.com/adamv/homebrew-alt/raw/master/duplicates/libxslt.rb
$ brew link libxslt
$ brew install libiconv
$ brew link libiconv
$ gem install nokogiri -- --with-xml2-dir=$BREW_HOME/Cellar/libxml2/2.7.8 --with-xslt-dir=$BREW_HOME/Cellar/libxslt/1.1.26 --with-iconv-dir=$BREW_HOME/Cellar/libiconv/1.13.1/
@njh
njh / bbc_episodes_for_brand.rb
Created May 3, 2011 15:47
Ruby code to get all the episode PIDs for a BBC Brand
#!/usr/bin/env ruby
require 'rubygems'
require 'rdf'
require 'rdf/rdfxml'
PROGRAMMES_URL = 'http://www.bbc.co.uk/programmes'
PO = RDF::Vocabulary.new("http://purl.org/ontology/po/")
brand_pid = 'b0081dq5'
@ezodude
ezodude / basic monitrc
Created October 15, 2010 06:00
basic monitrc
set daemon 60
set logfile syslog facility log_daemon
set mailserver localhost
set mail-format { from: [email protected] }
set alert root@localhost
set httpd port 2812 and
allow admin:test
include /etc/monit.d/*
@ezodude
ezodude / example vhost
Created October 15, 2010 05:54
nginx vhost example
server {
access_log /opt/nginx/logs/test_server.access.log main buffer=32k;
error_log /opt/nginx/logs/test_server.error.log info;
expires 6h;
listen 2300 default rcvbuf=64k backlog=128;
root /opt/apps/test_server/current/public;
server_name test_server.com www.test_server.com;
passenger_enabled on;
}
# gem install sunspot_rails
class Foo
include MongoMapper::Document
include Sunspot::Rails::Searchable
key :title, String
searchable do
text :title
end
class Product
include MongoMapper::Document
include MongoMapper::Sunspot
belongs_to :crawl
many :inventories
key :product_no, Integer
key :price_in_cents, Integer
# Hook our MongoMapper model into Solr
module MongoAdapter
class InstanceAdapter < Sunspot::Adapters::InstanceAdapter
def id
@instance.id
end
end
class DataAccessor < Sunspot::Adapters::DataAccessor
def load(id)