Skip to content

Instantly share code, notes, and snippets.

View AndySum's full-sized avatar

AndySum

View GitHub Profile
@ftvs
ftvs / CameraShake.cs
Last active May 2, 2025 13:33
Simple camera shake effect for Unity3d, written in C#. Attach to your camera GameObject. To shake the camera, set shakeDuration to the number of seconds it should shake for. It will start shaking if it is enabled.
using UnityEngine;
using System.Collections;
public class CameraShake : MonoBehaviour
{
// Transform of the camera to shake. Grabs the gameObject's transform
// if null.
public Transform camTransform;
// How long the object should shake for.
@AkhmadMax
AkhmadMax / Console.cs
Last active January 20, 2019 09:23 — forked from mminer/Console.cs
using UnityEngine;
using System;
using System.Collections.Generic;
/// <summary>
/// A console that displays the contents of Unity's debug log.
/// </summary>
/// <remarks>
/// Developed by Matthew Miner (www.matthewminer.com)
/// Permission is given to use this script however you please with absolutely no restrictions.
@nileshtrivedi
nileshtrivedi / computer.rb
Created October 5, 2011 16:30
A simple virtual machine to experiment with minimal instruction sets
# My attempt to implement a simple virtual machine with a minimal instruction set
# 8-bit computer, fixed-size memory, single cpu, 0-registers, based on von-neumann architecture
# No support for interrupts or I/O although we cheat and provide a "print" instruction :)
# The goal is to find a minimal, but turing-complete, instruction set
# For simplicity, every instruction has two operands, which are located adjacent to it in the memory
# This code is just to experiment with various instruction sets and not to be taken seriously
# Next fun step would be to develop a language/compiler for this virtual machine
class Memory
def initialize(size, program)