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 'factual/query/crosswalk' | |
unless Factual::Query::Crosswalk.instance_methods.include?(:namespace) | |
class Factual | |
module Query | |
class CrosswalkNamespace < Base | |
def initialize(api, params = {}) | |
@path = "places/crosswalk" | |
@action = :crosswalk |
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
// Remove the overlay node from the DOM | |
$('#overlay').parent().remove(); | |
// Restore the scrollbars | |
$('html').css( "overflow", "scroll" ); |
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
[ | |
"tableName", | |
[ | |
[ "field1", "type", "value" ], | |
[ "field2", "type", "value" ], | |
... | |
] | |
] |
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
void RecordLevelEndData() | |
{ | |
// Grab in-game data | |
float fHealth = GetPlayerHealth(); | |
unsigned nScore = GetPlayerScore(); | |
// Get an object that sends data to the | |
// "performance" table | |
wfStat* pStat = wfMetrics::Create( "performance" ); |
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
[ | |
"performance", | |
[ | |
// Project-specific metadata | |
[ "svn_revision", "s", "195388" ], | |
[ "platform", "s", "ps3" ], | |
[ "system_id", "s", "08EB4EEF3C76C468" ], | |
[ "timestamp", "d", "__server_timestamp__" ], | |
// Programmer-specified data |
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
# CAVEAT EMPTOR: This is excerpted code that I pulled out of context, | |
# re-arranged, renamed the variables of, and otherwise dicked around with | |
# a lot without having put it back into a Ruby interpreter, so it's | |
# possible that there's some gnarly typo or bug in here. In short, don't | |
# cut-and-paste this code. | |
class AlreadyLockedException < Exception; end | |
def redis_spinlock(redis, lock_handle, opts = {}, &critical_section) | |
lock_set = opts[:lock_set] || 'named_locks' |
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
# CAVEAT EMPTOR: This is excerpted code that I pulled out of context, | |
# re-arranged, renamed the variables of, and otherwise dicked around with | |
# a lot without having put it back into a Ruby interpreter, so it's | |
# possible that there's some gnarly typo or bug in here. In short, don't | |
# cut-and-paste this code. | |
# In our example, "cache" is some resource accessible by all of our | |
# processes and provides a run-time interface similar to Ruby's Hash | |
# class. | |
def cache_lookup(redis, resource_handle, cache, &run_on_cache_miss) |
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
// Declare and instantiate a signal for functions that take a | |
// single char arg. | |
JL_SIGNAL( char ) oKeyPressSignal; | |
// Two objects of unrelated type. | |
Piano oPiano; // plays notes | |
Transcriber oTranscriber; // generates text logs | |
// Lets assume the following instance method declarations: | |
// |
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
// For the purposes of this example, let's assume our slots only accept | |
// one parameter. | |
template< typename TSlotParam > | |
class Delegate | |
{ | |
public: | |
virtual ~Delegate() {} | |
virtual void Invoke( TSlotParam v ) = 0; | |
}; |
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
JL_SIGNAL() oSignal; | |
void f1() { oSignal.Disconnect( &f1 ); } | |
void f2() { /* do something */ } | |
oSignal.Connect( &f1 ); | |
oSignal.Connect( &f2 ); | |
oSignal.Emit(); |
OlderNewer