Skip to content

Instantly share code, notes, and snippets.

@bri-bri
bri-bri / 30secondTimer
Created March 10, 2013 18:23
Firing an ad every 30 seconds!
- (void)didFailToLoadInterstitial:(NSString *)location {
NSLog(@"failure to load interstitial at location %@", location);
[[Chartboost sharedChartboost] cacheInterstitial];
[NSTimer scheduledTimerWithTimeInterval:30
target:[Chartboost sharedChartboost]
selector:@selector(showInterstitial)
userInfo:nil
repeats:NO];
}
@bri-bri
bri-bri / gist:5314897
Created April 4, 2013 22:21
More Apps api response.
{
"status":200,
"message":"More apps returned.",
"data":
[
{
"url":"http:\/\/www.chartboost.com\/api\/click.json?to=5127f12c17ba47913100001c&uuid=xxxx1234xxxx1234&url=&cgn=-377bcd5879f8dce68aa96f6be946def8305d3ae7--default-&more_type=app&type=more&model=&country=US&os=&signature=5ed3ce71e0212b5d37a4dc853aaca310&app=5124171817ba47fb09000065",
"click_metadata":
{
"to":"5127f12c17ba47913100001c",
@bri-bri
bri-bri / gist:6597826
Last active December 23, 2015 06:59
For Sachin.
function convertObjectKeyToArray(obj,key) {
if( obj.hasOwnProperty(key) ) {
if( obj[key].constructor == Object ) {
new_array = [];
for ( objkey in obj[key] ) {
new_array.push(obj[key][objkey]);
}
obj[key] = new_array;
} else if(obj[key].constructor != Array ) {
print("{" + obj._id + "} has type " + typeof obj[key]+ " for key: " + key );