Skip to content

Instantly share code, notes, and snippets.

Avatar

Antony Courtney antonycourtney

View GitHub Profile
@antonycourtney
antonycourtney / FruitFragments.as
Last active Aug 29, 2015
Some Fruit layout code
View FruitFragments.as
-- Apply an affine transform (passed as static arg)
-- to any GUI:
transformGUI :: Transform -> GUI b c -> GUI b c
transformGUI tf g = proc (inp, b) ->
(pic, c) <- g -< (inverse tf %$ inp, b)
returnA -< (tf %$ pic, c)
-- Dynamic version of TransformGUI
-- Takes Transform input signal instead of
-- static arg:
@antonycourtney
antonycourtney / TimingTest.scala
Created Mar 23, 2015
Breeze MultivariateGaussian Timing Test
View TimingTest.scala
import breeze.linalg._
import breeze.math._
import breeze.stats.distributions._
object TimingTest {
def timeIt[R](block: => R): R = {
val t0 = System.nanoTime()
val result = block // call-by-name
@antonycourtney
antonycourtney / keybase.md
Created Jul 16, 2015
Keybase verification
View keybase.md

Keybase proof

I hereby claim:

  • I am antonycourtney on github.
  • I am antonycourtney (https://keybase.io/antonycourtney) on keybase.
  • I have a public key whose fingerprint is AB91 EB05 4FD6 D49C 7823 CACA F085 C3EC E772 A21D

To claim this, I am signing this object:

@antonycourtney
antonycourtney / Conference Form.md
Last active Aug 29, 2015
Proposed requirement for peer-reviewed conference papers
View Conference Form.md

Source Code and Data Set Availability

Papers published as part of this conference form part of the scientific record. As such, authors are expected to make all data sets, source code and related artifacts needed to reproduce the published results publicly available.

In rare cases papers may be accepted that do not meet this criteria. These papers must include a standard disclaimer on the title page (given below).

Please select one of the following:

@antonycourtney
antonycourtney / todoItem.js
Last active Oct 19, 2015
An individual TODO list item as an Immutable Record
View todoItem.js
/**
* todoItem.js - An individual item in the TODO list as an Immutable record
*/
export default class TodoItem extends Immutable.Record({
id: '',
complete: false,
text: ''
}) {
constructor(text,complete = false) {
super({id: genID(), text, complete});
@antonycourtney
antonycourtney / todoAppState.js
Last active Oct 19, 2015
Purely functional data structure for Todo list application state
View todoAppState.js
/**
* todoAppState.js -- Application State for TodoMVC as
* an immutable record
*/
export default class TodoAppState extends Immutable.Record({
todoItems: Immutable.Map() // map from id to TodoItem
}) {
/**
* functional item update -- returns a new state with the given item included in the
* set of todo items. If there is an existing entry for item.id, the result state
@antonycourtney
antonycourtney / todoAppStatic.React.js
Last active Oct 19, 2015
top level app component for static version of app
View todoAppStatic.React.js
/**
* todoApp.React.js -- top-level React component for TodoMVC
*/
export default class TodoApp extends React.Component {
render() {
const appState = this.props.appState;
const allTodos = appState.getAll();
return (
<div>
<Header />
@antonycourtney
antonycourtney / viewTest.js
Last active Oct 19, 2015
Test of static version of views
View viewTest.js
/**
* viewTest.js -- render TodoApp component with static test data
*/
const item0 = new TodoItem('This is a test item');
const state0 = new TodoAppState();
const todoAppState = state0.addItem(item0);
React.render(
<TodoApp appState={todoAppState} />,
document.getElementById('todoapp')
@antonycourtney
antonycourtney / TodoApp.React.js
Last active Oct 19, 2015
Top level View component for TodoMVC app
View TodoApp.React.js
/**
* todoApp.React.js -- top-level React component for TodoMVC
*/
export default class TodoApp extends React.Component {
render() {
const appState = this.props.appState;
const allTodos = appState.getAll();
return (
<div>
<Header stateRefUpdater={this.props.stateRefUpdater} />
@antonycourtney
antonycourtney / Header.react.js
Last active Oct 19, 2015
React Header component for oneref-todomvc
View Header.react.js
/**
* Header.react.js -- React component for TodoMVC Header UI
*/
import React from 'react';
import TodoTextInput from './TodoTextInput.react';
import * as TodoActions from '../todoActions';
export default class Header extends React.Component {
render() {
return (
You can’t perform that action at this time.