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;
@bricef
bricef / Sorted.fsx
Last active November 10, 2015 23:24
//#load "Spirograph.fs"
open System.Drawing
//open FSharp.TV.Spirograph
let round (x:float) = int (System.Math.Round (x))
module Seq =
let repeat items =
seq { while true do for item in items do yield item }
@bricef
bricef / NaiveBayesClassifier.fs
Created January 20, 2016 16:05
Spam Filtering in F# - without probability combinations
open System.IO
open System
type Label = Ham | Spam
let classify msg : Label = Spam
type Corpus = Map<Label, Map<string, float>>
type LabeledData = seq<Label*string>
@bricef
bricef / bayes.fs
Created January 25, 2016 09:27
Start to Bayes filtering in F#
// Learn more about F# at http://fsharp.net
// See the 'F# Tutorial' project for more help.
open System.IO
open System
// 01 - Defining the problem
type Label = Ham | Spam
let classify msg : Label =
Spam
@bricef
bricef / bayes.fs
Created February 16, 2016 14:48
A bayesian spam classifier
// Learn more about F# at http://fsharp.net
// See the 'F# Tutorial' project for more help.
open Argu
type Label = Spam | Ham
type Corpus = {
spamFreqs:Map<string, int>;
hamFreqs:Map<string, int>;
@bricef
bricef / foo.js
Created March 16, 2016 16:32
Example lecture desc
export default {
uid:"uid-00-begin-fsharp",
title: "First steps with F#",
level:0,
description:"Let's build stuff with F#...",
url_img:"https://placehold.it/250x250?text=First+Steps",
available:"available",
access:true,
content: [
{
@bricef
bricef / SMSSpamCollection.txt
Created April 5, 2016 17:19
Very Naive Bayesian Spam Filtering
ham Go until jurong point, crazy.. Available only in bugis n great world la e buffet... Cine there got amore wat...
ham Ok lar... Joking wif u oni...
spam Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&C's apply 08452810075over18's
ham U dun say so early hor... U c already then say...
ham Nah I don't think he goes to usf, he lives around here though
spam FreeMsg Hey there darling it's been 3 week's now and no word back! I'd like some fun you up for it still? Tb ok! XxX std chgs to send, £1.50 to rcv
ham Even my brother is not like to speak with me. They treat me like aids patent.
ham As per your request 'Melle Melle (Oru Minnaminunginte Nurungu Vettam)' has been set as your callertune for all Callers. Press *9 to copy your friends Callertune
spam WINNER!! As a valued network customer you have been selected to receivea £900 prize reward! To claim call 09061701461. Claim code KL341. Valid 12 hours only.
spam Had your mobile 11 months