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
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); |
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
class Node | |
attr_accessor :data, :adjacents, :visited? | |
def initialize(data) | |
self.data = data | |
self.visited? = false | |
self.adjacents = [] | |
end | |
end | |
def bfs(node) |
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
class Node | |
attr_accessor :data, :adjacents, :visited? | |
def initialize(data) | |
self.data = data | |
self.visited? = false | |
self.adjacents = [] | |
end | |
end | |
def dfs(node) |
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
//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; | |
} |
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
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; |
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
- (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 |
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
static public bool JsonDataContainsKey(JsonData data,string key) | |
{ | |
bool result = false; | |
if(data == null) | |
return result; | |
if(!data.IsObject) | |
{ | |
return result; | |
} | |
IDictionary tdictionary = data as IDictionary; |
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
import logging | |
from termcolor import colored | |
class ColorLog(object): | |
colormap = dict( | |
debug=dict(color='grey', attrs=['bold']), | |
info=dict(color='white'), | |
warn=dict(color='yellow', attrs=['bold']), |
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
brew update | |
brew versions FORMULA | |
cd `brew --prefix` | |
git checkout HASH Library/Formula/FORMULA.rb # use output of "brew versions" | |
brew install FORMULA | |
brew switch FORMULA VERSION | |
git checkout -- Library/Formula/FORMULA.rb # reset formula | |
## Example: Using Subversion 1.6.17 | |
# |
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
<!-- Start Playnomics API --> | |
<script type="text/javascript"> | |
_pnConfig={}; | |
_pnConfig.userId="<USER-ID>"; | |
var _pnAPIURL=document.location.protocol+"//js.a.playnomics.net/v1/api?a=<APPID>", | |
_pnAPI=document.createElement("script"); | |
_pnAPI.type="text/javascript";_pnAPI.async=true;_pnAPI.src=_pnAPIURL;document.body.appendChild(_pnAPI); | |
</script> | |
<!-- End Playnomics API --> |
NewerOlder