Skip to content

Instantly share code, notes, and snippets.

Avatar

Maxim Velesyuk maximvl

View GitHub Profile
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
@maximvl
maximvl / info.red
Created Sep 4, 2017 — forked from toomasv/info.red
To get info about any function
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!"]
]
@maximvl
maximvl / datatype-help.red
Created Mar 26, 2017 — forked from greggirwin/datatype-help.red
Small GUI experiment for showing datatype information.
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
@maximvl
maximvl / heart-animation.red
Created Jan 9, 2017 — forked from DideC/heart-animation.red
Heart animation for Red (only). Now with a complete control panel to play with the animations parameters. Nice time eater ;-)
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 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) {
You can’t perform that action at this time.