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
# Fitting.rb | |
# Version 0.1. Will package properly one day when it's all done and I get around to writing tests. | |
# Simple class for reading and writing CCP EVE Online Fitting Manager XML files. | |
# Generated Fitting classes with Module classes inside the Fitting's modules array attribute allow you to reproduce ships exactly. | |
# License: GPLv3 | |
# If you use this, feel free to donate iskies to Ix Forres. | |
require 'rubygems' | |
require 'hpricot' | |
require 'builder' | |
require 'ftools' |
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
# Using delayed_job and want to bring cache_money into the mix? Read on... | |
module Cash | |
module Query | |
class Abstract | |
delegate :with_exclusive_scope, :get, :table_name, :indices, :find_from_ids_without_cache, :cache_key, :columns_hash, :to => :@active_record | |
def self.perform(*args) | |
new(*args).perform | |
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
<?xml version="1.0" ?> | |
<eveOverview> | |
<tab bracket="battle (noblue)" name="battle" overview="battle (noblue)" showAll="True" showNone="False" showSpecials="False"/> | |
<tab bracket="normal" name="normal" overview="test" showAll="True" showNone="False" showSpecials="False"/> | |
<tab bracket="pos" name="pos" overview="pos" showAll="False" showNone="False" showSpecials="False"/> | |
<globalSettings> | |
<useSmallColorTags value="None"/> | |
<applyOnlyToShips value="None"/> | |
<hideCorpTicker value="0"/> | |
<overviewBroadcastsToTop value="1"/> |
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
o = Eve::Overviews::Overview.new(File.read("overviewtest.xml")) | |
# Rename our profiles so nothing collides. | |
o.profiles.each do |p| | |
p.name = "IMP #{p.name}" | |
end | |
# We don't want to hide the corp ticker if they're in an alliance | |
o.global_settings.hide_corp_ticker = false | |
# Let's enable the corporation label | |
o.ship_labels.detect{|sl|sl.type='corporation'}.state = true | |
# And write to a file |
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 'rubygems' | |
require 'reve' | |
path = "assets.msh" | |
file = File.open(path,'a+') | |
cid = 123098319308 | |
uid = 20391123123 | |
key = "YOURKEY" | |
api = Reve::API.new(uid,key) | |
assets = api.personal_assets_list(:characterid=>cid) |
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 goes in xchat's program files directory | |
title = 'Unknown Song' if title.empty? | |
artist = 'Unknown Artist' if artist.empty? | |
srate = track.samplerate / 1000.0 | |
string = "me is listening to \"\0034\002#{title}\002\003\" by \0034#{artist}\003" | |
string = "#{string} from \0034#{album}\003" unless album.empty? | |
string = "#{string} [#{position}..#{length}/#{track.bitrate}kbps/#{srate % 1 == 0 ? srate.to_i : srate}khz]" | |
puts string |
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
# Returns username,repository,commit (HEAD by default),branch (if a branch home URL) of a given github URL. | |
# Parameters: | |
# url (String) - The URL to parse | |
# The method makes some assumptions: | |
# * Repositories will never have a branch name exactly 40 characters long- this will always be a commit reference | |
# * Github only allows alphanum and hyphens as user or repository names | |
def parse_github_url(url) | |
if url.match(/github.com\/([\w\-]+?)\/([\w-]+)\/([\w-]+)\/(\w{,39}|\w{40,})/) # We've got a specific commit mentioned here | |
username,repository,commit,branch = $1,$2,($4),'master' | |
elsif url.match(/github.com\/([\w\-]+?)\/([\w-]+)\/([\w-]+)\/([\w-]+)/) |
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/python | |
# Face Detection using OpenCV. | |
# Based on sample code by Roman Stanchak | |
# Nirav Patel http://eclecti.cc 5/20/2008 | |
# Modified by James Harrison to do arbitrary output to stdout for headless commandline processing/'does this have a face' checking | |
# http://talkunafraid.co.uk | |
# Usage example: python lib/studiomonitor/face_detect.py --file some_picture.jpg | |
# Input pictures must be normalized to 320x240 by your weapon of choice. | |
# Return value is: number of faces detected, printed to stdout. |
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/python | |
# Changed pixel count script. Takes two images, -a and -b, and gives you the number of pixels for which greyscale intensity differs more than 10 between those images. | |
# TODO: Make the threshold an option | |
from PIL import Image,ImageOps | |
from optparse import OptionParser | |
import sys, os | |
def main(): |
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
# A small script to take a directory tree that looks like: | |
# /data/conversion/inbox | |
# /data/conversion/tmp | |
# /data/conversion/complete | |
# It will find any files in the inbox, use ffmpeg to convert them into .wav files, then move the result to the complete folder before cleaning up the inbox and tmpdir. | |
# It will handle nested folders - say, music files within artist and album directories. | |
require 'find' | |
paths_to_rm = [] | |
Find.find("/data/conversion/inbox/") do |path| |