Skip to content

Instantly share code, notes, and snippets.

@lepinekong
lepinekong / .system.coder.apps.vscode.extensions.doc.gen.red
Last active April 14, 2018 16:02
.system.coder.apps.vscode.install
Red [
Title: ".system.coder.apps.vscode.extensions.doc.gen.red"
Url: https://gist.github.com/lepinekong/a1b1bdff993fdfdb969e933eb14cd266
Parent: %.system.coder.apps.vscode.install.red
Authors: ["Lépine Kong"]
References: [
https://www.red-lang.org/2014/12/050-objects-support.html
]
Release: 1.0
Phase: "alpha"
do-trace: function [.line-number [integer!] '.block [word! block! unset!]
.file [file! url! string!]
/filter that-contains [string! file! url!]
][
file: form .file
if filter [
either not find file that-contains [exit][
]
]
Tutorials: [
https://dev.to/lepinekong/red-for-hopeless-programmers---part-i-3g0
https://dev.to/lepinekong/red-for-hopeless-programmers---part-ii-258
]
Demo-Instruction: {
can be pasted directly in Redlang Console (1 Mb download https://www.red-lang.org/p/download.html)
if you just want to see demo without downloading, type in Red console:
do read https://gist.githubusercontent.com/lepinekong/08021f2b8ecdd3e0dc09685ef0b0c03f/raw/c7b41adc9a3815f77c4bca815af35b598f920bc1/.system.user.apps.countdown.red
Countdown 00:25:00 Pomodoro
@lepinekong
lepinekong / .system.user.apps.countdown.red
Last active April 4, 2018 07:44
Opensource Countdown Timer / Pomodoro (with Voice Alarm for Windows, to adapt for MacOS and Linux)
Comment {
Redlang: https://red-lang.org
Tutorials: [
https://dev.to/lepinekong/red-for-hopeless-programmers---part-i-3g0
https://dev.to/lepinekong/red-for-hopeless-programmers---part-ii-258
]
Demo-Instruction: {
- Script below Red[] can be pasted directly in Redlang Console (1 Mb download https://www.red-lang.org/p/download.html)
- if you just want to see demo without downloading, type in Red console:
@lepinekong
lepinekong / red.scheme
Created March 15, 2018 23:24
red.scheme
<?xml version="1.0" encoding="UTF-8"?>
<Scheme>
<keyword-classes>
<keyword-class name="red.keywords">
about abs absolute add alert alias all alter and any any-block? any-function? any-string? any-type? any-word? append arccosine arcsine arctangent array as-pair ask at attempt back binary? bind bitset? block? break brightness? browse build-tag caret-to-offset catch center-face change change-dir char? charset checksum choose clean-path clear clear-fields close comment complement component? compose compress confirm connected? construct context copy cosine datatype? date? debase decimal? decode-cgi decompress dehex delete detab difference dir? dirize disarm dispatch divide do do-events does dump-face dump-obj echo either else email? empty? enbase entab equal? error? even? event? exclude exists? exit exp extract fifth file? find first flash focus for forall foreach forever form forskip found? fourth free func function function? get get-modes get-word? greater-or-equal? greater? halt has hash? head head? help h
@lepinekong
lepinekong / .system.override
Created March 14, 2018 11:09
.system.override
.system.override: function['.func-name][
Context [
func-name: form .func-name
func-src: get :.func-name
spec: mold/only spec-of :func-src
template: {if not value? 'sys<%func-name%> [
sys<%func-name%>: :<%func-name%>
<%func-name%>: function [<%spec%>][
@lepinekong
lepinekong / .code.analyze.red
Created March 13, 2018 18:51
.code.analyze
Red [
Title: ".code.analyze"
]
src: {Red [
Title: ".system.override.red"
]
if not value? 'syscd [
syscd: :cd
@lepinekong
lepinekong / .system.override.red
Created March 13, 2018 15:44
.system.override.red
Red [
Title: ".system.override.red"
]
if not value? 'syscd [
syscd: :cd
cd: func [
"Change directory (shell shortcut function)."
[catch]
'path [file! word! path! unset! string! paren! url!] "Accepts %file, :variables and just words (as dirs)"
@lepinekong
lepinekong / chartmage.latest
Last active April 27, 2018 22:24
flexible seach function in red
((Search)) - searchString /in 'path /ext 'extension ->> searchString: form searchString
subgraph Init
searchString: form searchString
searchString: form searchString ->> ext?
subgraph extension
ext? - Yes ->> extension: form extension
extension: form extension ->> extension: to-file extension
ext? - No ->> extension: %.md
end
extension: %.md ->> root: any [path %./]
@lepinekong
lepinekong / dsl.model.simulation
Last active March 9, 2018 15:14
DSL Draft for Modelisation and Simulation
Red [
Title: "DSL for Modelisation and Simulation of Business Entities"
]
Simulate Bank: Model [
Companies: [[Company]] ; companies is a collection of company which are potential clients of the bank
Company: [name Address (optional)]
Employees: [[Employee]] ; employees is a collection of employee
ThirdParties: [[ThirdParty]] ; thirdParties is a collection of thirdParty
ThirdParty: [