Skip to content

Instantly share code, notes, and snippets.

View animepauly's full-sized avatar

Paul Borawski animepauly

View GitHub Profile
@animepauly
animepauly / fetchUser.js
Created August 2, 2017 15:44
fetchUser method from React.js web app
export function fetchUser(__userIdNum, __authTokenStr) {
return function (dispatch) {
dispatch(requestUser(__userIdNum));
const __url = `${BASE_URL}/api/user?id=${__userIdNum}`;
let __headers = new Headers();
__headers.append("Content-Type", 'application/json');
__headers.append("X-API-Auth-Token", __authTokenStr);
@animepauly
animepauly / gist:4fcf9d8f6b0557180814c98d69f3ffe5
Created August 2, 2017 15:06
Failed Request/Response headers sent from adunit.adphenom.com
*General*
Request URL:https://portal-dev.adphenom.com/api/user?id=164
Request Method:OPTIONS
Status Code:403 Forbidden
Remote Address:52.201.157.189:443
Referrer Policy:no-referrer-when-downgrade
*Response Headers*
Connection:keep-alive
Content-Length:0
@animepauly
animepauly / gist:591ceca2f044bae5323f669e33970702
Created August 2, 2017 15:04
correct Request/Response headers from local server call
*General*
Request URL:http://localhost:3000/api/user?id=164
Request Method:GET
Status Code:200 OK
Remote Address:127.0.0.1:3000
Referrer Policy:no-referrer-when-downgrade
*Response Headers*
Access-Control-Allow-Origin:*
connection:close
* Connected to portal-dev.adphenom.com (52.201.157.189) port 443 (#0)
* TLS 1.2 connection using TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
* Server certificate: *.adphenom.com
* Server certificate: Amazon
* Server certificate: Amazon Root CA 1
* Server certificate: Starfield Services Root Certificate Authority - G2
> GET /api/user/177 HTTP/1.1
> Host: portal-dev.adphenom.com
> User-Agent: curl/7.50.3
> Accept: */*
@animepauly
animepauly / gist:13c356da75cc6245f83c8fe1f3be9305
Created August 2, 2017 14:59
beforeFilter() method in APIController()
public function beforeFilter(Event $event)
{
parent::beforeFilter($event);
$this->response->cors($this->request)
->allowOrigin(['http://adunit.adphenom.com/'])
->allowMethods(['GET', 'POST'])
->allowHeaders(['X-API-Auth-Token'])
->allowCredentials()
->exposeHeaders(['Link'])
@animepauly
animepauly / gist:bbdb1e87d30516fe87b3
Last active January 11, 2016 22:29
OneSignal Unity error log for Android
Error building Player: CommandInvokationFailure: Unable to convert classes into dex format. See the Console for details.
/Library/Java/JavaVirtualMachines/jdk1.8.0_51.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/paulborawski/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
stderr[
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/SignInButton;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/data/DataBufferUtils;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/data/Freezable;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/data/DataHolder;
Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/data/DataHo
@animepauly
animepauly / log.txt
Created November 11, 2015 19:09
iOS NativeEditBox crash
CrashReporter: initialized
2015-11-11 13:02:29.716 adphenom[730:254620] -> registered mono modules 0x1af7500
2015-11-11 13:02:30.205 adphenom[730:254620] You've implemented -[<UIApplicationDelegate> application:didReceiveRemoteNotification:fetchCompletionHandler:], but you still need to add "remote-notification" to the list of your supported UIBackgroundModes in your Info.plist.
-> applicationDidFinishLaunching()
PlayerConnection initialized from /private/var/mobile/Containers/Bundle/Application/1ACA8873-F3A7-4EA5-9EC4-EADEA0B088C1/adphenom.app/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55000
Multi-casting "[IP] 26.193.49.190 [Port] 55000 [Flags] 3 [Guid] 1496054334 [EditorId] 721985901 [Version] 1048832 [Id] iPhonePlayer(Paulys-iPhone-5c):56000 [Debug] 1" to [225.0.0.222:54997]...
Waiting for connection from host on [26.193.49.190:55000]...
Timed out. Continuing without host connection.
<-- This is in Plugins/Android -->
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.adquizition.adphenom" android:installLocation="preferExternal" android:versionCode="1" android:versionName="1.0">
<supports-screens android:smallScreens="true" android:normalScreens="true" android:largeScreens="true" android:xlargeScreens="true" android:anyDensity="true" />
<permission android:name="com.adquizition.adphenom.permission.C2D_MESSAGE" android:protectionLevel="signature" />
<uses-permission android:name="com.adquizition.adphenom.permission.C2D_MESSAGE" />
<application android:icon="@drawable/app_icon" android:label="@string/app_name" android:debuggable="true">
@animepauly
animepauly / gist:e55956491d22d4382345
Created October 15, 2015 18:22
Unity iOS prime31 video freeze log
CrashReporter: initialized
2015-10-15 12:29:45.099 adphenom[3919:1391719] -> registered mono modules 0x1a4f680
-> applicationDidFinishLaunching()
PlayerConnection initialized from /private/var/mobile/Containers/Bundle/Application/09D696B3-91EE-4159-8ED0-2561E2448C69/adphenom.app/Data (debug = 0)
PlayerConnection initialized network socket : 0.0.0.0 55000
Multi-casting "[IP] 22.217.80.161 [Port] 55000 [Flags] 3 [Guid] 2532154818 [EditorId] 1490885077 [Version] 1048832 [Id] iPhonePlayer(Paulys-iPhone-5c):56000 [Debug] 1" to [225.0.0.222:54997]...
Waiting for connection from host on [22.217.80.161:55000]...
Timed out. Continuing without host connection.
-> applicationDidBecomeActive()
@animepauly
animepauly / LoadImageFromWebService
Last active August 29, 2015 14:16
A simple image loading manager in C# for the Unity StrangeIOC framework. I had to stop getting all images at once as I was running out of threads. This solution is my first attempt
using System;
using UnityEngine;
using UnityEngine.UI;
using System.Collections;
using System.Collections.Generic;
using strange.extensions.context.api;
using strange.extensions.dispatcher.eventdispatcher.api;
using Parse;
namespace adquizition.quizapp