This file contains hidden or 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
class Foo | |
def self.with_class_eval(&block) | |
class_eval(&block) | |
end | |
end | |
Foo.with_class_eval do | |
def some_method | |
puts "Some method" | |
end |
This file contains hidden or 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
var caller = function(val, cb) { | |
var result = cb(val); | |
if (result == 1) { | |
return true; | |
} | |
else { | |
console.log("Invalid response " + result); | |
} | |
console.log("I'm never shown if result == 1"); | |
} |
This file contains hidden or 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 'stomp' | |
# | |
# == Example message consumer. | |
# | |
class ExampleConsumer | |
# Initialize. | |
def initialize | |
end | |
# Run example. |
This file contains hidden or 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
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]> |
This file contains hidden or 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
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]> |
This file contains hidden or 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
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]>; |
This file contains hidden or 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
class SomeMethod | |
extend FFI::Library | |
attach_function :cmethod, :pointer | |
def mystical_value=(value) | |
@value = FFI::MemoryPointer.new(:string, value) | |
cmethod(@value) | |
end | |
end |
This file contains hidden or 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
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"); |
This file contains hidden or 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
module MTData | |
class MTDataConnection < ActiveRecord::Base | |
establish_connection "mtdata" | |
end | |
module Perth | |
class Place < MTDataConnection | |
self.table_name = "[Perth].[dbo].[Place]" | |
end |
This file contains hidden or 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
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 |