Skip to content

Instantly share code, notes, and snippets.

thread = Thread.new do
require 'b.rb'
end
thread.join()
// -------------------- Describe the tables --------------------
plugin.db.table("department", {
name: { type:"text" },
roomNumber: { type:"int", nullable:true }
}, {
// Define a method on the row objects
fancyStuff: function(ping) { return ping + " pong"; }
});
var contacts_button2 = O.plugin("contacts_button2", {
// Called when an object's page is requested
hObjectDisplay: function(response, object) {
// Build a list of menu items, which depend on the type of the object being displayed.
// Menu items link to an object editor for a new object which links to the current object.
// Only add a menu item if the user has permission to create the proposed object.
var menuItems = [];
if((object.isKindOf(SCHEMA.O_TYPE_ORGANISATION) || object.isKindOf(SCHEMA.O_TYPE_PERSON))
&& O.currentUser.hasPermissionToCreateObjectOfType(SCHEMA.O_TYPE_CONTACT_NOTE)) {
menuItems.push(['/do/contacts/add_note/'+object.ref, 'Add Contact note'])
# Apple Binary Property List serializer for Ruby 1.8.
require 'iconv'
module AppleBinaryPropertyList
MIME_TYPE = 'application/octet-stream' # Don't know what to use, so use a very generic type for now
CFData = Struct.new(:data) # For marking strings as binary data which will be decoded as a CFData object
72.13.91.46 - - [01/Feb/2010:17:29:24 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.36 - - [01/Feb/2010:17:29:24 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.40 - - [01/Feb/2010:17:29:24 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.44 - - [01/Feb/2010:17:29:24 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.38 - - [01/Feb/2010:17:29:24 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.46 - - [01/Feb/2010:17:31:06 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.40 - - [01/Feb/2010:17:31:07 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.36 - - [01/Feb/2010:17:31:07 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.44 - - [01/Feb/2010:17:31:07 +0000] "GET /images/ben.jpg HTTP/1.1" 200 3092 "-" "Java/1.6.0_18"
72.13.91.38 - - [01/Feb/2010:17:31:07 +0000] "GET /images/ben.jpg HTTP/1.1" 200
@bensummers
bensummers / annotations.rb
Created August 16, 2009 15:32
Is this a hacky way to do annotations in ruby?
# Annotations module, enable in base class with "extend Annotations"
module Annotations
def method_added(method_name)
a = self.instance_variable_get(:@_annotated_next_method)
if a != nil
_annotation_storage(:@_annotated_methods,{})[method_name] = a
self.instance_variable_set(:@_annotated_next_method, nil)
end
super