Skip to content

Instantly share code, notes, and snippets.

View edward's full-sized avatar

Edward Ocampo-Gooding edward

View GitHub Profile
--- simplerdb-0.2/lib/simplerdb/db.rb 2008-03-15 17:56:16.000000000 +0000
+++ simplerdb-0.2/lib/simplerdb/db.rb 2008-10-20 12:03:37.000000000 +0100
@@ -128,15 +128,22 @@
attribute_params.each { |attr| item.put_attribute(attr.to_attr, attr.replace) }
end
- def delete_attributes(domain_name, item_name, attributes)
+ def delete_attributes(domain_name, item_name, attributes = [])
domain = @domains[domain_name]
item = domain.items[item_name]
def make_sandwiches(however_many)
sandwiches = []
however_many.times do
sandwiches << make_sandwich { |sandwich| yield sandwich }
end
sandwiches
end
def make_sandwich
sandwich = "=======\n"
@edward
edward / gist:19899
Created October 26, 2008 15:12 — forked from guenin/gist:19898
def make_sandwiches(however_many)
sandwiches = []
however_many.times do
sandwiches << make_sandwich { |sandwich| yield sandwich }
end
sandwiches
end
def make_sandwich
puts "makin a sandwich"
$ wine --debugmsg --start Steam.exe
fixme:advapi:SetEntriesInAclA 1 0x33f7ec 0x0 0x33f824
fixme:advapi:SetSecurityInfo stub
fixme:advapi:SetEntriesInAclA 1 0x33f7d8 0x0 0x33f820
fixme:advapi:SetSecurityInfo stub
fixme:advapi:SetEntriesInAclA 1 0x33f7f8 0x0 0x33f840
fixme:advapi:SetSecurityInfo stub
fixme:process:SetProcessShutdownParameters (00000100, 00000000): partial stub.
CellID: Fetching server list from CSDS. . .
CellID: CSDS returned 201 servers.
@edward
edward / nginx-0.6.32-with-upload-progress.ebuild
Created October 29, 2008 17:49
nginx gentoo ebuild with upload progress module support
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/www-servers/nginx/nginx-0.6.32.ebuild,v 1.2 2008/10/25 17:36:52 voxus Exp $
inherit eutils ssl-cert
DESCRIPTION="Robust, small and high performance http and reverse proxy server"
UPLOADPROGRESS="nginx_uploadprogress_module"
~ UPDATE `videos` SET `updated_at` = '2008-10-30 16:44:25', `notification` = '0', `status` = 'error' WHERE (`id` = '52da2ef0-88cf-012b-7d8f-1231390084f5')
~ Unable to transcode file 52da2ef0-88cf-012b-7d8f-1231390084f5: RVideo::TranscoderError::UnknownError - Unexpected RVideo error: exit (SystemExit)
~ SELECT `id`, `filename`, `original_filename`, `parent`, `status`, `duration`, `container`, `width`, `height`, `video_codec`, `video_bitrate`, `fps`, `audio_codec`, `audio_bitrate`, `audio_sample_rate`, `profile`, `profile_title`, `player`, `queued_at`, `started_encoding_at`, `encoding_time`, `encoded_at`, `last_notification_at`, `notification`, `updated_at`, `created_at`, `thumbnail_position` FROM `videos` WHERE (`id` = '555d2ba0-88cb-012b-7d8f-1231390084f5') ORDER BY `id` LIMIT 1
~ Error sending error using ErrorSender.log_and_email - very erroneous! (undefined method `to_h' for #<Hash:0xb64c56d8>)
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require(File.join(File.dirname(__FILE__), 'config', 'boot'))
require 'rake'
require 'rake/testtask'
require 'rake/rdoctask'
require 'tasks/rails'
1) Error:
test: Statistic on videos should report their total served count for a specific date. (StatisticTest):
NoMethodError: You have a nil object when you didn't expect it!
The error occurred while evaluating nil.owned_context
/Users/edward/Work/VideoJuicer/vj-core/app/models/stored_asset.rb:79:in `context'
/Users/edward/Work/VideoJuicer/vj-core/app/models/stored_asset.rb:72:in `slug'
/Users/edward/Work/VideoJuicer/vj-core/app/models/stored_asset.rb:60:in `contextualized_path'
/Users/edward/Work/VideoJuicer/vj-core/app/models/stored_asset.rb:113:in `store_in_file_system'
/Users/edward/Work/VideoJuicer/vj-core/app/models/stored_video.rb:25:in `store_in_file_system'
/Library/Ruby/Gems/1.8/gems/activerecord-2.0.4/lib/active_record/callbacks.rb:307:in `send'
$(document).ready(function() {
$('form.amazon').submit(function() {
$.getJSON("amazon/search",
{ terms: "ipod nano" },
function(data) {
$.each(data.products, function(i, product) {
$("<div/>").text(product).appendTo("form.amazon .results");
});
};
);
class Hash
def except(*blacklist)
self.reject {|key, value| blacklist.include?(key) }
end
def only(*whitelist)
self.reject {|key, value| !whitelist.include?(key) }
end
end