Skip to content

Instantly share code, notes, and snippets.

View jaredjenkins's full-sized avatar

Jared Jenkins jaredjenkins

  • Chronosphere
  • Chicago
View GitHub Profile
- (BOOL) application: (UIApplication *) application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
//Enable test mode to view your events in the Validator. Remove this line of code before releasing your game to the app store.
[Playnomics setTestMode: YES];
const unsigned long long applicationId = <APPID>;
[Playnomics startWithApplicationId:applicationId];
//preloads the frames at game start
[Playnomics preloadFramesWithIds:@"frame-ID-1", @"frame-ID-2", @"frame-ID-2", @"frame-ID-3", nil];
//other code to initialize your iOS application below this
id<PlaynomicsFrameDelegate> frameDelegate;
/*
frameDelegate is delegate which observes state changes in the frame:
@protocol PlaynomicsFrameDelegate <NSObject>
@optional
-(void) onShow: (NSDictionary *) jsonData;
-(void) onTouch: (NSDictionary *) jsonData;
@jaredjenkins
jaredjenkins / gist:8554909
Created January 22, 2014 07:43
Debugging GooglePlayServices availability
//copy this into an activity
public boolean isGooglePlaySdkAvailable(){
try{
Class.forName("com.google.android.gms.common.GooglePlayServicesUtil");
return true;
} catch(ClassNotFoundException exception){
logger.log(LogLevel.WARNING, "Google Play Services are not available on this device.");
}
return false;
}
@jaredjenkins
jaredjenkins / depth_first_search.rb
Created February 4, 2014 20:07
Depth First Search
class Node
attr_accessor :data, :adjacents, :visited?
def initialize(data)
self.data = data
self.visited? = false
self.adjacents = []
end
end
def dfs(node)
@jaredjenkins
jaredjenkins / breadth_first_search.rb
Created February 4, 2014 20:17
Breadth First Search
class Node
attr_accessor :data, :adjacents, :visited?
def initialize(data)
self.data = data
self.visited? = false
self.adjacents = []
end
end
def bfs(node)
package main
//#cgo pkg-config: python2.7
//#include <Python.h>
//static PyObject *runtime_log_fn;
//
//void runtime_log(char *msg)
//{
// if (runtime_log_fn == NULL) {
// free(msg);