Skip to content

Instantly share code, notes, and snippets.

View ympbyc's full-sized avatar
💭
Lisping in the mountains.

Minori Yamashita ympbyc

💭
Lisping in the mountains.
View GitHub Profile
@ympbyc
ympbyc / ctyp-dep-graph.svg
Last active January 18, 2017 06:18
Typed Clojure dependency graph. download raw and open in Adobe Illustrator.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ympbyc
ympbyc / arduino.scm
Created November 17, 2015 06:59
voc with fields
(load "./field.scm")
(use srfi-27)
(random-source-randomize! default-random-source)
(define c 10)
(define-class <arduino> (<thing>)
((sensors :init-keyword :sensors
:init-value '() ;;[field-name]
@ympbyc
ympbyc / 1-simulation.scm
Last active November 28, 2016 01:58
場を使った相対論的オブジェクト間コミュニケーション
(load "./2-voc-w-field.scm")
(define-class <cat> (<thing>)
((body-temperature :init-keyword :body-temperature
:accessor body-temperature)))
(define-class <sun> (<thing>)
((temperature :init-keyword :temperature
:accessor temperature)))
{
"app_id": "Bird.sample.fruits_machine",
"models": {
"fruits": [
"grape",
"orange",
"strawberry",
"orange",
"strawberry",
"strawberry",
/*
* Author: 2015 Minori Yamashita [email protected]
*/
var origin = {x: 160, y:340};
var canvas = document.getElementById("space");
//http://stackoverflow.com/questions/9960908/permutations-in-javascript
function permutate (arr) {
return arr.reduce(function permute(res, item, key, arr) {
return res.concat(arr.length > 1
@ympbyc
ympbyc / ekolu.js
Created March 26, 2015 09:20
ekolu sketch
window.Ekolu = (function () {
var ekolu = {};
ekolu.xyz = function (x, y, z) {
return {x: x, y: y, z: z};
};
ekolu._Thread = function (coordinates_system, pos_rot, ai, vision, visual) {
this.coordinates_system = coordinates_system || _.identity;
this.pos_rot = pos_rot || function (t) { return ekolu.xyz(0,0,0); };
this.ai = ai || [];
@ympbyc
ympbyc / kakahiaka_util.js
Last active November 28, 2016 01:58
コレクションの差分取ってよしなにやってくれる偉いヤツ
(function (K) {
K.util = {};
K.util.dom = {};
//[a] * [a] * (a->HTMLElement) * HTMLElement * $ -> ()
//collとold_collの差分を計算してelに反映させる
K.util.dom.render_collection_change = function (coll, old_coll, f, el, $) {
var $el = $(el);
var $children = $(el).children();
var children = $children.get();
@ympbyc
ympbyc / method-missing-option.carrot.clj
Last active November 28, 2016 01:58
Option map digging w/ method-missing
(= (some a (Option a)) x x)
(= (some? (Option a) Bool) x (not (none? x)))
(= (none (Option a)) nil)
(= (none? (Option a) Bool) x (nil? x))
(= (get (Option a) a) x x)
(= (get-or-else (Option a) a a)
opt default
(some? opt (get opt) default))
@ympbyc
ympbyc / cv.md
Last active August 29, 2015 14:04
My resume

Minori Yamashita

916-462-2011 [email protected] 502 Cobble Creek Circle, Rocklin CA

Work History

DARUZEN, DARUMAZA FACTORY; BOSTON, US — 2014
@ympbyc
ympbyc / Car.js
Last active December 30, 2016 06:29
Pull-based Async Objects -- Demo
//1 dimentional, constant speed car
//private
function _Car (vision, address, speed, id) {
this.visual = {id: id, brake_light: false, address: address, _speed: speed + "mph", _car: this};
this._vision = vision;
this._speed = speed;
this._brake = function () {
this.visual.brake_light = true;