Skip to content

Instantly share code, notes, and snippets.

@seaders
seaders / pycharm_sqlalchemy.py
Created March 1, 2018 12:59
Pycharm Pro SQLAlchemy fragility
import weakref
from sqlalchemy import \
Column, Integer, String, MetaData, ForeignKey
from sqlalchemy.ext.declarative import \
declarative_base, DeclarativeMeta, declared_attr
from sqlalchemy.orm import \
relationship
# noinspection PyProtectedMember
from sqlalchemy.ext.declarative.api import \
_declarative_constructor
git clone <PRIVATE REPO>
cd sdk
git fetch --all
git pull --all
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
git branch --track "${branch##*/}" "$branch"
done
git fetch --all
git pull --all
cd ..
using UnityEngine;
using System.Collections;
public class TestScript : MonoBehaviour
{
void Start()
{
StartCoroutine( waitForASec() );
}
using UnityEngine;
using System.Collections;
public class InputScript : MonoBehaviour
{
float _lastLR;
void Start ()
{
UnityEngine.Apple.TV.Remote.reportAbsoluteDpadValues = true;
diff --git a/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs b/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs
index e3af984..ccf16c0 100644
--- a/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs
+++ b/Assets/bolt/scripts/udpkit/Native/NativePInvoke.cs
@@ -38,11 +38,11 @@ public static class NativePInvoke {
[DllImport(DLL_NAME)]
[SuppressUnmanagedCodeSecurity]
- public static extern Int32 SendTo(IntPtr socket, [Out] byte[] buffer, int size, UdpEndPoint.Native addr);
+ public static extern Int32 SendTo(IntPtr socket, byte[] buffer, int size, UdpEndPoint.Native addr);
private IEnumerator _doFlash(bool first)
{
_mesh.colors32 = _darkColours[_colourIndex];
MainScript.log( "flashing to", this, MainScript.joinL(_mesh.colors32) );
yield return new WaitForSeconds(0.3f);
_mesh.colors32 = _colours[_colourIndex];
MainScript.log("flashing back to", this, MainScript.joinL(_mesh.colors32) );
yield return new WaitForSeconds(0.3f);
}
void LocalNotification(NSString* body, int seconds, NSString* action)
{
UILocalNotification *localNotification = [ [UILocalNotification alloc] init ];
if(localNotification == nil)
{
return;
}
// Set the fire date/time
[ localNotification setFireDate: [ [NSDate date] dateByAddingTimeInterval: seconds ] ];
package com.sixminute.freeracing;
import android.app.Activity;
import android.os.AsyncTask;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.Button;
import org.apache.http.HttpResponse;
@seaders
seaders / tokenPatch.patch
Last active August 29, 2015 14:26
Patch file to update 0.9.21 of `play-games-plugin-for-unity` to enable getting of a user's access token.
diff --git a/Assets/GooglePlayGames/BasicApi/DummyClient.cs b/Assets/GooglePlayGames/BasicApi/DummyClient.cs
index 337469f..cc7f754 100644
--- a/Assets/GooglePlayGames/BasicApi/DummyClient.cs
+++ b/Assets/GooglePlayGames/BasicApi/DummyClient.cs
@@ -43,6 +43,18 @@ public class DummyClient : IPlayGamesClient
LogUsage();
}
+ public string GetAccessToken()
+ {
diff -r 983242b3e120 -r be189741ef87 PlatformDependent/iPhonePlayer/iPhone-Trampoline/Classes/Unity/WWWConnection.h
--- a/PlatformDependent/iPhonePlayer/iPhone-Trampoline/Classes/Unity/WWWConnection.h Thu May 14 11:57:01 2015 +0100
+++ b/PlatformDependent/iPhonePlayer/iPhone-Trampoline/Classes/Unity/WWWConnection.h Wed May 27 12:14:52 2015 +0300
@@ -22,6 +22,7 @@
@property (readonly, nonatomic) void* udata;
@property (nonatomic) BOOL shouldAbort;
+@property (atomic) BOOL done;
@end