Skip to content

Instantly share code, notes, and snippets.

View waynerobinson's full-sized avatar

Wayne Robinson waynerobinson

View GitHub Profile
module MyMixin
def self.included(base)
puts base.to_s
end
end
module TopLevel
class MyClass
include MyMixin
end
module MyMixin
def test_constant
puts MY_CONSTANT
end
end
class Foo
MY_CONSTANT = "BLAH"
include MyMixin
end
module MTData
module CityDatabaseConfig
def self.included(base)
base.establish_connection "mtdata"
city_name = self.to_s.match(/::(.+)::.+$/)[1]
base.table_name = "[#{city_name}].[dbo].[Place]"
end
end
module MTData
class MTDataConnection < ActiveRecord::Base
establish_connection "mtdata"
end
module Perth
class Place < MTDataConnection
self.table_name = "[Perth].[dbo].[Place]"
end
static int performance_file_is_complete_if(char *filename_cp)
{
int bytes = 0;
int nl = 0;
int first_character = TRUE;
char c;
char line[READ_BUFFER_SIZE];
FILE *fh_tp;
fh_tp = fopen(filename_cp, "r");
class SomeMethod
extend FFI::Library
attach_function :cmethod, :pointer
def mystical_value=(value)
@value = FFI::MemoryPointer.new(:string, value)
cmethod(@value)
end
end
@waynerobinson
waynerobinson / email.txt
Created January 13, 2014 00:16
Virgin Active Website Issue
Delivered-To: [email protected]
Received: by 10.70.19.33 with SMTP id b1csp81980pde;
Thu, 9 Jan 2014 22:18:29 -0800 (PST)
X-Received: by 10.68.16.202 with SMTP id i10mr8923109pbd.149.1389334709133;
Thu, 09 Jan 2014 22:18:29 -0800 (PST)
Return-Path: <>
Received: from mail.expeed.com.au (mail.expeed.com.au. [202.136.110.111])
by mx.google.com with ESMTP id t6si6079714pbg.215.2014.01.09.22.18.27
for <[email protected]>;
Delivered-To: [email protected]
Received: by 10.70.19.33 with SMTP id b1csp59819pde;
Thu, 16 Jan 2014 07:46:06 -0800 (PST)
X-Received: by 10.58.119.161 with SMTP id kv1mr3012961veb.21.1389887164842;
Thu, 16 Jan 2014 07:46:04 -0800 (PST)
Return-Path: <[email protected]>
Received: from mail-ve0-f174.google.com (mail-ve0-f174.google.com [209.85.128.174])
by mx.google.com with ESMTPS id uo18si3515584veb.105.2014.01.16.07.46.03
for <[email protected]>
Delivered-To: [email protected]
Received: by 10.70.19.33 with SMTP id b1csp59815pde;
Thu, 16 Jan 2014 07:46:05 -0800 (PST)
X-Received: by 10.224.103.131 with SMTP id k3mr16931160qao.102.1389887164839;
Thu, 16 Jan 2014 07:46:04 -0800 (PST)
Return-Path: <[email protected]>
Received: from github-smtp2b-ext-cp1-prd.iad.github.net (github-smtp2-ext2.iad.github.net. [192.30.252.193])
by mx.google.com with ESMTPS id jx12si10144988qeb.130.2014.01.16.07.46.02
for <[email protected]>
require 'rubygems'
require 'stomp'
#
# == Example message consumer.
#
class ExampleConsumer
# Initialize.
def initialize
end
# Run example.