Skip to content

Instantly share code, notes, and snippets.

View BrianGenisio's full-sized avatar

Brian Genisio BrianGenisio

View GitHub Profile
private function math_dist(mmx:int, mmy:int, ox:int, oy:int):Number{
return Math.sqrt((mmx-ox)*(mmx-ox)+(mmy-oy)*(mmy-oy));
}
private function point_dist(p1:Point, p2:Point):Number{
return Point.distance( p1, p2 );
}
private function time_it():void {
import org.jasmineflex.global.*;
describe("adding", function():void {
it("sums two values", function():void {
expect(1 + 1).toBe(2);
});
});
package
{
include "mathSpec.as"
import flash.display.Sprite;
import org.jasmineflex.*
public class asJasmine extends Sprite
{
public function asJasmine()
var model = Backbone.Model.extend({
setProcessors: {
"name": requireLowerCase,
"sometingElse": someOtherFunction
},
requireLowerCase: function(value) {
return value.toLowerCase();
},
firstNames = JSLINQ(myList).Select (item) -> item.FirstName
@BrianGenisio
BrianGenisio / gist:1472549
Created December 13, 2011 15:34 — forked from nhajratw/gist:1468963
Trying to get basic CoffeeScript/Backbone working
window.app =
models: {}
views: {}
class app.models.OfferClass extends Backbone.Model
class app.models.OfferClasses extends Backbone.Collection
model: app.models.OfferClass
url: "/offerClasses"
@BrianGenisio
BrianGenisio / QuestionHub.cs
Created November 25, 2012 17:41
Backbone.rsync.js usage. Request for comments.
public class QuestionHub : BackboneModelHub<Question>
{
private static readonly List<Question> questions = new List<Question>();
protected override Question CreateModel(Question question)
{
question.Id = Guid.NewGuid();
questions.Add(question);
return question;
}
module.exports = require('lineman').config.extend('application', {
server: {
web: {
port: process.env.PORT
}
}
});
port = process.env.PORT || 3001
app = require('express').createServer()
serveUp = (res, filename) ->
console.log "REQUESTING: ", filename
res.sendfile "#{__dirname}#{filename}"
app.get "/", (req, res) -> serveUp res, "/index.html"
app.get "/*", (req, res) -> serveUp res, req.url
@BrianGenisio
BrianGenisio / index.html
Created June 9, 2013 17:30
A CodePen by BrianGenisio. Simple Animations - Using D3.js, animate the points as they are drawn
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script>