View main.js
var MyApp = angular.module('MyApp'); | |
MyApp.factory('msgBus', ['$rootScope', function($rootScope) { | |
var msgBus = {}; | |
msgBus.emitMsg = function(msg, data) { | |
data = data || {}; | |
$rootScope.$emit(msg, data); | |
}; | |
msgBus.onMsg = function(msg, func, scope) { | |
var unbind = $rootScope.$on(msg, func); | |
if (scope) { |
View heart-animation.red
Red [ | |
title: "Heart animation" | |
author: "Didier Cadieu" | |
notes: { | |
Traduction in Red/Rebol of Terebus Volodymyr javascript demo : http://codepen.io/tvolodimir/pen/wqKuJ | |
} | |
Needs: View | |
] | |
;*** Settings |
View datatype-help.red
Red [] | |
form-all: func [blk][ | |
forall blk [blk/1: form blk/1] | |
blk | |
] | |
types-of: function [value [typeset!]][ | |
; typesets don't support reflection | |
third load mold value |
View info.red
Red [] | |
info: func ['fn /name /intro /args /refinements /locals /return /spec | |
/arg-num /arg-names /arg-types /ref-names /ref-types /ref-num /type | |
/local intr ars refs locs ret arg ref typ | |
][ | |
intr: copy "" ars: make map! copy [] refs: make map! copy [] locs: copy [] ret: copy [] typ: ref-arg: ref-arg-type: none | |
if lit-word? fn [fn: to-word fn] | |
unless find [op! native! function! action!] type?/word get fn [ | |
cause-error 'user 'message ["Only function types accepted!"] | |
] |
View l-system.red
Red [ | |
Author: "Toomas Vooglaid" | |
Date: 25-9-2017 | |
Description: {Experiments with L-System} | |
] | |
ctx: context [ | |
scale: origin: length: len: angle: width: delta-width: times-length: delta-length: delta-angle: aliasing?: stack: commands: none | |
defaults: [ | |
scale 2.0 | |
origin 300x500 |