Skip to content

Instantly share code, notes, and snippets.

@zerosalife
zerosalife / .block
Last active February 17, 2017 00:38
Scatterplot with regression line
license: cc-by-nc-sa-4.0
@zerosalife
zerosalife / hexcrawl-notes.org
Created February 6, 2016 13:57
Notes for a hexcrawl application

Views

Map

Example image

Notification of Map Code and URL to share

Collection of tiles

Background image?

@zerosalife
zerosalife / LINQExample.cs
Created October 15, 2015 17:52
Example of using LINQ expressions to program in a functional style
using UnityEngine;
using System.Collections;
using System.Linq;
// Place this script on an object in your scene (e.g. the Main Camera)
// and run.
public class LINQExample: MonoBehaviour {
public void Start() {
int[] counters = new int[] {0, 1, 2, 3};
using UnityEngine;
using System.Collections;
public class Ball : MonoBehaviour {
public float maxHeight;
public float minHeight;
public float timeToReachMaxHeight;
private float jumpVelocity;
private float gravity;
@zerosalife
zerosalife / MakeDictionaryOfLists.cs
Created June 20, 2015 16:11
Create a Dictionary of Lists in Unity C#
using UnityEngine;
using System.Collections.Generic;
public class MakeDictionaryOfLists : MonoBehaviour {
Dictionary<string, List<int>> table = new Dictionary<string, List<int>>();
void Start() {
// Fill our table with Lists containing ints using Arrays to intialize
// the Lists.
table["a"] = new List<int>(){1};
@zerosalife
zerosalife / MakeDictionaryOfLists.js
Created June 6, 2015 15:10
Create a Dictionary of Lists in Unity JavaScript
#pragma strict
import System.Collections.Generic;
// White space matters.
var table:Dictionary.<String,List.<int> > = new Dictionary.<String,List.<int> >();
// Fill our table with Lists containing ints using Arrays to intialize
// the Lists.
table["a"] = new List.<int>([1]);
table["b"] = new List.<int>([2]);
@zerosalife
zerosalife / gist:53308e64bb5ba273d428
Created January 13, 2015 16:54
Draft of a blog post about video game book clubs

Book Club

What?

Who?

You, your friends, the cat (If you have one. No catnapping.), anyone with interest in critically discussing video games

When?

#pragma strict
var size: float;
function Awake() {
var m: Mesh = CreateBoxMesh(size);
var obj: GameObject = CreateGameObject();
// Attach Mesh `m' to the GameObject `obj'.
obj.GetComponent(MeshFilter).mesh = m;
using UnityEngine;
using System.Collections;
using System;
using System.Runtime.Serialization.Formatters.Binary;
using System.IO;
public class GameController: MonoBehaviour {
public static GameController control;
public int experiencePoints;
@zerosalife
zerosalife / Custom.mac-kb.xml
Created February 19, 2014 17:21
An emacs-like key binding scheme for MonoDevelop.
<schemes version="1.0">
<scheme name="current">
<binding command="MonoDevelop.Ide.Commands.EditCommands.Copy" shortcut="Alt+W" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.Cut" shortcut="Control+W" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.IndentSelection" shortcut="Control+X|Tab" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.LowercaseSelection" shortcut="Control+X|Control+L" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.Paste" shortcut="Control+Y" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.Redo" shortcut="" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.SelectAll" shortcut="Control+X|H" />
<binding command="MonoDevelop.Ide.Commands.EditCommands.Undo" shortcut="Control+_" />