Skip to content

Instantly share code, notes, and snippets.

@lepinekong
lepinekong / .system.user.apps.jot.note.red
Last active April 27, 2018 22:54
Jot note v1.0 always on top with timestamp and resize window
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: {
- Install Red:
- Download and install from https://www.red-lang.org/p/download.html
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: {
Just paste the content of .ReAdABLE.HumanFormat.deploy.ps1 in Powershell at:
https://gist.github.com/lepinekong/b59fa3e8d386dea1ebaa1a096488c542
It will install Red and the source of the Article, the markdown and a batch file to re-execute it.
Red [
Title: ".system.libraries.shell.red"
Uses: [
%.system.libraries.string.red
]
]
;for remote execution
unless value? '.string.compose [
github-url-entry: https://gist.github.com/lepinekong/f007c5358104f0469d8b1ea7da11650e
$demo="JsonResume";$github='https://gist.github.com/lepinekong/8ed36d43b7888625fd856e0c7ed68f28';$demofolder="C:\red\demos\$demo";Add-Type -AssemblyName Microsoft.VisualBasic;$demofolder=[Microsoft.VisualBasic.Interaction]::InputBox("Enter folder for $demo demo:", $demo, $demofolder);if ($demofolder -ne $null) {$exefolder="C:\red";$demo=Split-Path $demofolder -Leaf;[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;$WebResponse = Invoke-WebRequest -Uri "$github";$links=$WebResponse.Links | Select href | Where-Object {$_.href -match 'JsonResume.red'};$link=$links[0].href;$src="https://gist.githubusercontent.com$link";$exeurl='https://static.red-lang.org/dl/win/red-063.exe';New-Item -ItemType Directory -Force -Path $red-folder;New-Item -ItemType Directory -Force -Path $demofolder;New-Item -ItemType Directory -Force -Path "$demofolder";$Webcli=New-Object System.Net.WebClient;if (!(Test-Path `"$exefolder\red.exe`")) {$Webcli.DownloadFile("$exeurl","$exefolder\red.exe")};"Red [] `n pri
Red [
title: "autoload.red"
]
;==============================================================================================================================
options-args: system/options/args ; block of command line arguments
current-dir: to-red-file options-args/1
options-script: system/options/script ; launched script path
;==============================================================================================================================
See youtube below for easy install instruction (just copy and paste oneliner in Powershell) and demo tour of Text-to-speech with Cortana:
https://www.youtube.com/watch?v=u3rIyxtpEFY
//+--------------------------------------------------------+
//| adapted for FILE_SHARE_READ from BP-Ticks-1.0.mq4 |
//+--------------------------------------------------------+
// File identificator
int file;
uint startTick;
uint tickTime;
datetime theTime;
Red []
.use: func [locals [block!] body [block!]][
do bind body make object! collect [
forall locals [keep to set-word! locals/1]
keep none
]
]
use: :.use
@lepinekong
lepinekong / .ReAdABLE.HumanFormat.deploy.ps1
Last active July 5, 2018 14:59
ReAdABLE.HumanFormat: a new standard format easier to read, write and maintain to generate Markdown (and much more coming). Just copy and paste .ReAdABLE.HumanFormat.deploy.ps1 oneliner content in Powershell to download.
$demo="ReAdABLE.Human.Format";$github='https://gist.github.com/lepinekong/b59fa3e8d386dea1ebaa1a096488c542';$githublib='https://gist.github.com/lepinekong/7574892bfefe7e53e7bd4dd4759f30f8';$demofolder="C:\red\demos\$demo";$exefolder="C:\red";$exeurl='https://static.red-lang.org/dl/win/red-063.exe';Add-Type -AssemblyName Microsoft.VisualBasic;$demofolder=[Microsoft.VisualBasic.Interaction]::InputBox("Enter folder for $demo demo:", $demo, $demofolder);if ($demofolder -ne $null) {$demo=Split-Path $demofolder -Leaf;Function Get-Github-Links {Param($uri);[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;$WebResponse = Invoke-WebRequest -Uri "$uri";return $ResponseLinks=$WebResponse.Links | Select href};Function Filter-Link {Param($filter);$links = $AllLinks | Where-Object {$_.href -match "$filter"};$link=$links[0].href;return $link};Function Get-Github-Url {Param($filename);$link=Filter-Link $filename;$url="https://gist.githubusercontent.com$link";return $url};$AllLinks = Get-Github-L
New-Item -ItemType Directory -Force -Path C:\red;(New-Object System.Net.WebClient).DownloadFile('https://static.red-lang.org/dl/win/red-063.exe','c:\red\red.exe');Start-Process -Filepath 'c:\red\red.exe'