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
@ezodude
ezodude / Procfile
Created November 7, 2012 16:54 — forked from mojodna/Procfile
Getting Kue working on Heroku
web: node app.js
worker: node consumer.js
module God
module Conditions
class RestartFileTouched < PollCondition
attr_accessor :restart_file
def initialize
super
end
def process_start_time
Time.parse(`ps -o lstart -p #{self.watch.pid} --no-heading`)
@ezodude
ezodude / KeychainItemWrapper.h
Created December 16, 2011 14:32 — forked from dhoerl/KeychainItemWrapper.h
KeychainItemWrapper ARCified
/*
File: KeychainItemWrapper.h
Abstract:
Objective-C wrapper for accessing a single keychain item.
Version: 1.2 - ARCified
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
Inc. ("Apple") in consideration of your agreement to the following
terms, and your use, installation, modification or redistribution of
@ezodude
ezodude / gist:1278237
Created October 11, 2011 14:32 — forked from retr0h/gist:1001477
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/
@ezodude
ezodude / encoder.sh
Created August 17, 2011 14:47
Multi-Step Encoder
#!/bin/bash
# SET FFMPEG BINARY LOCATION
FFMPEG_BIN=/usr/local/bin/ffmpeg
# MAKE A FIFO
mkfifo pipe-a.y4m
mkfifo pipe-v.y4m
# DECODE VIDEO
@ezodude
ezodude / Throttling
Created August 14, 2011 10:35 — forked from arrel/Throttling
Throttle bandwidth to individual domains on os x
#!/bin/bash
# if you do not have access to run the script, run "chmod 755 throttling"
# to run enter in terminal "./throttling [speed]"
# full (no throttling)
# fast (300Kbit)
# medium (100Kbit)
# slow (10Kbit)
# wwdc (1Kbit)
# off (blocks connection)
@ezodude
ezodude / profile.sh
Created July 25, 2011 15:13 — forked from njh/profile.sh
# Use Fink (if available)
test -r /sw/bin/init.sh && . /sw/bin/init.sh
# In Mac OS X, what network location is set?
if [ -f "/usr/sbin/scselect" ]; then
export LOCATION=$(/usr/sbin/scselect 2>&1 | perl -ne 'if (m/^\s+\*\s+(\S+)\s+\((.+)\)$/) { print "$2\n"; }')
echo "Network Location: $LOCATION"
fi
#!/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 / FlickrService
Created March 27, 2011 11:49
FlickrService
# encoding: utf-8
class FlickrService
def initialize
@api_key = YAML.load_file(File.join(Dir.getwd, "config/flickr_service.yml"))["api_key"]
end
def photo_info_for(flickr_image_uri)
begin
result = {}
@ezodude
ezodude / Solr Indexing in Batches
Created March 10, 2011 14:25
Will turn this snippet into a rake task
def index_in_batches(klass, criteria={})
offset = 0
while true do
list = klass.all(criteria.merge(:limit => 30, :offset => offset))
break if list.empty?
Sunspot.index(list)
Sunspot.commit
offset += 30
end
end