Skip to content

Instantly share code, notes, and snippets.

@agramonte
agramonte / nodejsDreamModule.js
Last active Mar 20, 2021
Retrieves Geo location from the header ip.
View nodejsDreamModule.js
let ip = event.headers["x-forwarded-for"];
let event_type = steps.trigger.event.query.event_type;
let api_key = steps.trigger.event.query.api_key;
var geo;
var geoip = require('geoip-lite');
if (ip) {
geo = geoip.lookup(ip);
View analyticsGS.js
// ====================================================================================================
//
// Cloud Code for analytics, write your code here to customize the GameSparks platform.
//
// For details of the GameSparks Cloud Code API see https://docs.gamesparks.com/
//
// ====================================================================================================
var baseURL = "https://api2.amplitude.com/2/httpapi"
//Required
View analytics.php
<?php
if( $_GET["api_key"] && ($_GET["user_id"] || $_GET["device_id"] ) && $_GET["event_type"] ) {
// Required data
$data = array(
'event_type' => $_GET['event_type']
);
if( $_GET["user_id"] ) {
@agramonte
agramonte / AdIntegrator.java
Created Feb 28, 2021
buildbox 3.x custom appodeal sdk integration
View AdIntegrator.java
package com.buildbox.adapter.custom;
import android.app.Activity;
import android.util.Log;
import com.appodeal.ads.Appodeal;
import com.appodeal.ads.BannerCallbacks;
import com.appodeal.ads.InterstitialCallbacks;
import com.appodeal.ads.RewardedVideoCallbacks;
import com.appodeal.ads.api.App;
View ironsourceSKAdNetwork.xml
<dict><key>SKAdNetworkIdentifier</key><string>"su67r6k2v3.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"4dzt52r2t5.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"bvpn9ufa9b.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"488r3q3dtq.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"424m5254lk.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"v79kvwwj4g.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"22mmun2rn5.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"kbd757ywx3.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"zmvfpc5aq8.skadnetwork"</string></dict>
<dict><key>SKAdNetworkIdentifier</key><string>"wzmmz9fp6w.skadnetwork"</string></dict>
@agramonte
agramonte / json
Created Jan 26, 2021
solar2d - skadnetworkitems for ironsource (all lower case)
View json
SKAdNetworkItems = {
{ SKAdNetworkIdentifier = "su67r6k2v3.skadnetwork" },
{ SKAdNetworkIdentifier = "4dzt52r2t5.skadnetwork" },
{ SKAdNetworkIdentifier = "bvpn9ufa9b.skadnetwork" },
{ SKAdNetworkIdentifier = "488r3q3dtq.skadnetwork" },
{ SKAdNetworkIdentifier = "424m5254lk.skadnetwork" },
{ SKAdNetworkIdentifier = "v79kvwwj4g.skadnetwork" },
{ SKAdNetworkIdentifier = "22mmun2rn5.skadnetwork" },
{ SKAdNetworkIdentifier = "kbd757ywx3.skadnetwork" },
{ SKAdNetworkIdentifier = "zmvfpc5aq8.skadnetwork" },
View js
// Version 3.0: Saving and retrieving a shared table.
// Version 2.1: Added header so that returned table gets encoded correctly.
// Version 2.0: Save and retrieve table
// Version 1.0: Login
// Change these parameters for your game
var returnFalseOnLock = true;
var requestType = Spark.getData().requestType;
var tableData = Spark.getData().params;
Spark.setScriptData("RESPONSE_HEADERS", {"content-type":"text/html; charset=utf-8"});
@agramonte
agramonte / main.lua-Corona
Created Dec 9, 2019
Example of making editable grid.
View main.lua-Corona
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
local composer = require( "composer" )
local json = require( "json" )
local scene = composer.newScene()
local widget = require "widget"
View gist:f6140dfb57c0db06084df84609c43883
local gameSparkKey = "<myKey>"
local gameSparkSecret = "<mySecret>"
local gameSparkPropertyName = "pageServerVersions"
local json = require( "json" )
local gs = require("plugin.gamesparks")
local G = {}
@agramonte
agramonte / lua.json
Last active Oct 22, 2018 — forked from mika76/lua.json
Corona SDK snippers for VS Code
View lua.json
{
"gs.setLogger":{
"body": "gs.setLogger( ${1:listener} )",
"description": "Set Gamesparks logging listener.",
"prefix": "gs.setLogger"
},
"gs.setApiKey":{
"body": "gs.setApiKey( ${1:key} )",
"description": "Set Gamespark key.",
"prefix": "gs.setApiKey"