Skip to content

Instantly share code, notes, and snippets.

@codemaster
codemaster / migrate-redis.py
Last active April 3, 2018 18:29 — forked from thomasst/migrate-redis.py
Migrate Redis data on Amazon ElastiCache
"""
Copies all keys from the source Redis host to the destination Redis host.
Useful to migrate Redis instances where commands like SLAVEOF and MIGRATE are
restricted (e.g. on Amazon ElastiCache).
The script scans through the keyspace of the given database number and uses
a pipeline of DUMP and RESTORE commands to migrate the keys.
Requires Redis 2.8.0 or higher.
using System;
using System.Collections.Generic;
#if NET_4_6
using System.Threading.Tasks;
#endif
/// <summary>
/// Event manager
/// </summary>
public class EventManager : IEventManager
@codemaster
codemaster / Singleton.cs
Created November 15, 2016 07:07
Unity Singleton Helper Classes
/// <summary>
/// Singleton class
/// </summary>
public class Singleton<T> where T : new()
{
/// <summary>
/// Holds the actual instance
/// </summary>
private static T _instance;
@codemaster
codemaster / CameraShake.cs
Created April 23, 2016 17:49
Unity Script that shakes the camera!
using UnityEngine;
//! Script that shakes the camera
public class CameraShake : MonoBehaviour
{
//! The amplitude/strength of the shake.
//! Higher values shake the camera harder.
public float shakeAmplitude = 0.7f;
//! Dampen is how fast our shake stops. Default is 1.
public float dampenFactor = 1.0f;

Keybase proof

I hereby claim:

  • I am codemaster on github.
  • I am codemaster (https://keybase.io/codemaster) on keybase.
  • I have a public key whose fingerprint is EC11 A426 8385 C6A5 9791 B1A1 AD4E F22E F6C6 DD9D

To claim this, I am signing this object: