Skip to content

Instantly share code, notes, and snippets.

View draegtun's full-sized avatar

Barry Walsh draegtun

View GitHub Profile
-module(dp383).
-export([same_necklace/2, repeats/1, bonus2/0, test_examples/0]).
%
% see - https://www.reddit.com/r/dailyprogrammer/comments/ffxabb/20200309_challenge_383_easy_necklace_matching/
same_necklace(A, B) when length(A) =/= length(B) -> false;
same_necklace(A, B) ->
case string:find(A ++ A, B) of
@draegtun
draegtun / so-example.st
Created December 11, 2017 16:15
Example Smalltalk code for SO
| session data |
session := ZnClient new url: 'http://cloud-storage.com'.
"Login"
session path: '/login';
formAt: 'email' put: 'jom';
formAt: 'password' put: 'mypass';
post.
@draegtun
draegtun / CHANGES.md
Created June 8, 2017 14:12
Final draft of CHANGES
@draegtun
draegtun / README.md
Created June 7, 2017 14:09
testing readme

Make CHANGES.md (for Ren/C repo)

CHANGES.md keeps a list of notable changes to this repo grouped by release and type of change.

This process will automatically create a new CHANGES.md

Files

Along with this README.md in /scripts/changes-file/ you will also find:

@draegtun
draegtun / CHANGES.md
Created June 2, 2017 19:48
Example CHANGES
@draegtun
draegtun / console.md
Last active May 15, 2017 10:06
User and Console wiki draft

User and Console

see: https://github.com/r3n/reboldocs/wiki/User-and-Console

This documents the changes to User & Console experience in Ren/C branch of Rebol 3.

Console

This is Rebol's REPL (Read-Eval-Print-Loop). Simply running Rebol from command-line without any options will start the console:

@draegtun
draegtun / system-proposal.md
Last active May 5, 2017 07:38
What to do with system/user and system/options??

system/options/home

On Rebol 2 this points to user home directory (on Linux/OSX this is get-env 'HOME). On r3 this is currently set to where the r3 executable lives.

As it stands we should rename system/options/home to make it clear this is where executable lives and avoid confusing with $HOME. See %rebol.r

We can then reclaim system/options/home to replicate R2 behaviour (if we like?)

system/user or system/options?

@draegtun
draegtun / rebol.vim
Created April 27, 2017 08:28
Rebol VIM syntax file
" Vim syntax file
" Language: Rebol
" Maintainer: Mike Williams <mrw@netcomuk.co.uk>
" Filenames: *.r
" Last Change: 2001 May 09
" URL: N/A
" Changes-by: Barry Walsh <draegtun@gmail.com>
" Last updated: 17-May-2013
@draegtun
draegtun / repl-skin.reb
Last active June 8, 2018 22:59
An example REPL config file (~/.rebol/repl-skin.reb)
Rebol [
title: "example REPL skin config"
date: 30-Mar-2017
version: 0.0.1
]
;; shortcuts I like!
q: :quit
?: :help
@draegtun
draegtun / simple-lambda-example.reb
Last active September 6, 2018 09:38
Very simple anonymous lambda generator in Rebol
>> double: lambda [? * 2]
>> double 2
== 4
>> double: lambda [? + ?]
>> double 4
== 8
>> add2: lambda [?1 + ?2]
>> add2 2 4