Skip to content

Instantly share code, notes, and snippets.

@bricef
bricef / test.js
Last active August 29, 2015 14:05
#pragma strict
var damage = 20;
var vel = Vector2(0,10);
var boom : AudioClip;
function Start () {
rigidbody2D.velocity = vel;
}
using UnityEngine;
using System.Collections;
public class ChangeOnCollision : MonoBehaviour {
private Material myMaterial;
void Start () {
myMaterial = GetComponent<Renderer>().material;
}
using UnityEngine;
using System.Collections;
public class ChangeOnCollision : MonoBehaviour {
private Material myMaterial;
// Use this for initialization
void Start () {
myMaterial = GetComponent<Renderer>().material;
@bricef
bricef / FormationController.cs
Last active August 29, 2015 14:21 — forked from Jaandlu/gist:71f1a3f14df43a523dad
Update on boundary code
using UnityEngine;
using System.Collections;
public class FormationController : MonoBehaviour {
public GameObject enemyPrefab;
public float width = 10;
public float height = 5;
public float speed;
public float padding;
find ./ -type d -exec du -sh {} \;
find ./ -name *.txt -type f -exec sed -i 's/old/new/g' {} \;
ls -1 > ALLFILES
sort MANIFEST MANIFEST ALLFILES| uniq -u | xargs rm
ls -1 | sort MANIFEST MANIFEST - | uniq -u | xargs rm
#! /usr/bin/env python
import xml.etree.ElementTree as ET
import Image
import ImageDraw
import numpy as np
import sys, re, os
files = os.listdir(sys.argv[1])
files.sort()
regex = re.compile("[0-9]+\.xml")
// Will work as expected
"foo|bar|spam|eggs".split("\\|");
//will get a compilation error
"foo|bar|spam|eggs".split("\|");
//will split on each character
"foo|bar|spam|eggs".split("|");