Skip to content

Instantly share code, notes, and snippets.

Jacob Eiting jeiting

Block or report user

Report or block jeiting

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeiting
jeiting / psdkAnalyticsServiceWrapper.mm
Last active Jan 29, 2019 — forked from daveweaver/psdkAnalyticsServiceWrapper.mm
Originator / Revenue Cat integration
View psdkAnalyticsServiceWrapper.mm
/*
The main class in this file is the AnalyticsServiceWrapper. It handles any connections to analytics services we
use, such as Google Analytics, crash reporting, revenue reporting, etc., and of course Adjust and Revenue Cat. This
is fairly old code, which is why it's written as a C++ class that contains Objective-C calls.
*/
#import <AdSupport/ASIdentifierManager.h>
#import "Adjust.h"
#import "Purchases.h"
View verify_apple_receipt.py
# Load the contents of the receipt file
receipt_file = open('./receipt_data.bin', 'rb').read()
# Use asn1crypto's cms definitions to parse the PKCS#7 format
from asn1crypto.cms import ContentInfo
pkcs_container = ContentInfo.load(receipt_file)
# Extract the certificates, signature, and receipt_data
certificates = pkcs_container['content']['certificates']
signer_info = pkcs_container['content']['signer_infos'][0]
View restore.m
/**
This method will post all purchases associated with the current App Store account to RevenueCat and become associated with the current `appUserID`.
If this App Store account is already associated with another `appUserID` that has an active subscription this will produce an error. This prevents one App Store account from providing subscriptions for multiple users. This is the default behavior.
If the App Store account has no active subscriptions or purchases it will restore and transfer purchases and subscriptions to the current `appUserID`.
If you want to transfer purchases even if there is an active subscription, you can set this in the RevenueCat web app. You should use this if you app doesn't have a seperate account to system that you use to restore purchases.
*/
- (void)restorePurchasesForAppStoreAccount;
View observer.swift
func paymentQueue(_ queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) {
for transaction in transactions {
switch(transaction.transactionState) {
case .purchasing:
break;
case .purchased:
case .restored:
handlePurchase(transaction);
case .failed:
handleFailure(transaction);
View lqr.py
import gym
import numpy as np
env = gym.make('CartPole-v0')
x = env.reset()
# x, xdot, theta, thetadot
gamma = (4.0 / 3.0 - env.masspole / env.masscart)
View gist:bf1149fa928f193b00774dbf279d5985
"""
This will be a very simple control method consisting of one set of weights and biases (theta)
that is optimized via CEM.
"""
import gym
from gym import wrappers
import numpy as np
class DiscreteDeterministicControlPolicy():
def __init__(self, mean, std_dev, observation_dim, action_dim):
View link
View gist:6060065
11111 5
11110 4
11101 4
11100 3
11011 4
11010 3
11001 3
11000 2
10111 4
10110 3
View gist:6041258
{
"id": "Bloon",
"content": {
"default" : {
"description": "Default",
"adapter": {
"type": "SimpleConceptAdapter",
"config": {
"question": "foreign_word",
"answer": "native_word",
You can’t perform that action at this time.