Skip to content

Instantly share code, notes, and snippets.

View jaredjenkins's full-sized avatar

Jared Jenkins jaredjenkins

  • Chronosphere
  • Chicago
View GitHub Profile
@jaredjenkins
jaredjenkins / REST ATOM Example
Created April 3, 2012 17:00
REST HTTP Example
GET /blog/posts HTTP 1.1
HOST: example.com
Content-Type: application/atom+xml
Content-Length: ...
<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>
Blog Posts
</title>
The Request:
OPTIONS /blog/post HTTP 1.1
HOST: example.com
The Response:
200 OK
Allow: POST
public enum FilePermissions
{
None,
Read,
Write,
ReadWrite,
Delete,
Full
}
@jaredjenkins
jaredjenkins / BinaryOperations
Created November 15, 2012 01:28
BinaryOperations
// represented in binary as 00000000000000000000000000000001
int one = 1;
// represented in binary as 00000000000000000000000000000010
int two = 2;
// represented in binary as 00000000000000000000000000000011
int three = one | two;
// represented in binary as 00000000000000000000000000000100
int four = 4;
// represented in binary as 00000000000000000000000000000000
int zero = four & three;
@jaredjenkins
jaredjenkins / FilePermissions.cs
Created November 17, 2012 02:07
FilePermissions - Class
public static class FilePermissions
{
public const int None = 1;
public const int Read = 2;
public const int Write = 4;
public const int ReadWrite = Read | Write;
public const int Delete = 8;
public const int Full = Read | Write | Delete;
}
@jaredjenkins
jaredjenkins / FilePermissionsFlags.cs
Created November 17, 2012 02:48
FilePermissionsFlags
[Flags]
public enum FilePermissions : uint
{
None = 1,
Read = 2,
Write = 4,
ReadWrite = Read | Write,
Delete = 8,
Full = Read | Write | Delete
}
@jaredjenkins
jaredjenkins / Unity PlayRM engagement
Created April 5, 2013 18:50
Initialize the PlayRM engagement module
Playnomics.instance.startPlaynomics(<APPLICATION-ID>, <USERT-ID>);
Playnomics.instance.startPlaynomics(<APPLICATION-ID>);
using UnityEngine;
using PlaynomicsPlugin;
public class FirstScene : MonoBehaviour
{
void Start() {
Playnomics.instance.start(1234567890123456789L, "Z6q3UAtVwcxw35p9y");
}
}
import PlaynomicsPlugin;
function Start () {
Playnomics.instance.startPlaynomics(1234567890123456789L);
}
@jaredjenkins
jaredjenkins / UnityMessagingSetup
Last active December 15, 2015 23:10
Unity Messaging
using PlaynomicsPlugin;
using UntiyEngine;
public class Scene : MonoBehavior {
private MessagingFrame frame;
private bool shown;
private void Awake(){
MessagingFrame frame = Playnomics.instance.initMessagingFrame(<PLAYNOMICS-FRAME-ID>);
//enabled code callbacks, eg PNA