Skip to content

Instantly share code, notes, and snippets.

@paulhayes
paulhayes / DllLoadingAtRuntimeExample.cs
Last active February 21, 2024 14:00
Runtime loading dlls in Unity3d
using System;
using UnityEngine;
public class DllLoadingAtRuntimeExample : MonoBehaviour
{
static IntPtr nativeLibraryPtr;
delegate int MultiplyFloat(float number, float multiplyBy);
delegate void DoSomething(string words);
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@sjlongland
sjlongland / amqp.py
Last active November 14, 2018 14:13
Tornado Coroutine interface to AMQP (pika)
#!/usr/bin/python
import datetime
import logging
import threading
import weakref
import tornado
import tornado.gen
import pika
@maxd
maxd / teamcity
Last active November 11, 2021 16:28
Startup script for TeamCity (put it to /etc/init.d/teamcity)
#!/bin/sh
# /etc/init.d/teamcity - Startup script for TeamCity
#
#
# Register the startup script to run automatically:
#
# sudo update-rc.d teamcity defaults
#
@andyzinsser
andyzinsser / client.m
Last active September 28, 2018 23:19
Full flow of authenticating a Game Center Player on a third party server.
// request Game Center verification data for localPlayer from apple
- (void)authenticateGameCenterPlayer:(GKLocalPlayer *)localPlayer
{
[localPlayer generateIdentityVerificationSignatureWithCompletionHandler:^(NSURL *publicKeyUrl, NSData *signature, NSData *salt, uint64_t timestamp, NSError *error) {
if (error) {
NSLog(@"ERROR: %@", error);
}
else {
// package data to be sent to server for verification
NSDictionary *params = @{@"publicKeyUrl": publicKeyUrl,
@halkeye
halkeye / sorted_json.rb
Created April 2, 2012 23:13
Puppet module for outputting json in a sorted consistent way
#
# sorted_json.rb
# Puppet module for outputting json in a sorted consistent way. I use it for creating config files with puppet
require 'json'
def sorted_json(json)
if (json.kind_of? String)
return json.to_json
elsif (json.kind_of? Array)