Skip to content

Instantly share code, notes, and snippets.

{
"customer": {
"id": "25ff7d67-9056-4423-8711-7e18c7fc82d0",
"firstName": "Lucy",
"lastName": "Blank",
"email": "blank@welucy.com",
"country": "SG",
"status": "ACTIVE",
"wallets": [
{
{
"customer": {
"id": "801a6016-50b0-4e39-bd0a-6091b69b65be",
"firstName": "Dewi",
"lastName": "Sri",
"email": "dewi@welucy.com",
"country": "SG",
"status": "ACTIVE",
"wallets": [
{
{
"customer": {
"id": "801a6016-50b0-4e39-bd0a-6091b69b65be",
"firstName": "Dewi",
"lastName": "Sri",
"email": "dewi@welucy.com",
"country": "SG",
"status": "ACTIVE",
"wallets": [
{
@jmagnuss
jmagnuss / ApolloIdempotent.ts
Created February 1, 2020 01:25
Empty plugin sample for Apollo Server
import {
ApolloServerPlugin,
GraphQLRequestContext,
GraphQLRequestListener,
GraphQLServiceContext,
GraphQLResponse,
} from 'apollo-server-plugin-base';
import {
ApolloError,
AuthenticationError,
// IonObjectConverter.ts
import { Reader, IonType, IonTypes } from "ion-js";
/**
* IonObjectConverter
* Helper module to take Ion results (QLDB query records) and output Javascript / TS objects for use in
* your code / REST API.
*
* See notes here: https://amzn.github.io/ion-docs/guides/cookbook.html#down-converting-to-json
* and Issue here: https://github.com/amzn/ion-js/issues/531
Verifying my Blockstack ID is secured with the address 1LFb34MjNvAf8LX2VpJ7zjS61KVDLV4vAW https://explorer.blockstack.org/address/1LFb34MjNvAf8LX2VpJ7zjS61KVDLV4vAW
private $_uid;
private $_rows = [];
public function __constructor($uid) {
$_uid = $uid;
}
public function load() {
$records = DB::table("user_stats")->where("uid",$this->_uid)->getAll()
foreach ($records as $rec) {
@jmagnuss
jmagnuss / AndroidManifest.xml
Last active August 29, 2015 14:20
Showing a basic manifest with the required USES-PERMISSION elements added for SuperRewards
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.superrewards.srtest" >
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<activity
@jmagnuss
jmagnuss / gist:e2e512281cda025149c2
Created March 18, 2015 20:18
Get carrier on Android and iOS
/* ANDROID */
public static String getCarrier(Context mContext)
{
TelephonyManager manager = (TelephonyManager)mContext.getSystemService(Context.TELEPHONY_SERVICE);
String carrierName = manager.getNetworkOperatorName();
if (carrierName.length() > 0) {
return carrierName;
} else {
@jmagnuss
jmagnuss / build_url_with_minimum.php
Created November 13, 2014 05:48
SuperRewards Example: Minimum offer payout
<?php
$app_hash = "nhhpuxlrfgi.022815956433";
$secret_key = "dc08b6d41de7b0c467a66b6acb9e9a4d";
$uid = 123456;
$payout_min = 5;
$min_srt = md5($payout_min . $secret_key);
printf("URL: http://wall.superrewards.com/super/offers?h=%s&uid=%d&payout_min=%d&min_srt=%s\n", $app_hash, $uid, $payout_min, $min_srt);