This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(relation) { | |
lines := new map | |
replace("\\s+", " ") | | |
splitMany() | addTail(["0"]) | | |
for line do | |
continue if [ #line < 7 ] | |
if [ line[0] =~ "0|1" ] do | |
keys(lines) | [lines[_]] | for l if [ l[7] = relation ] do | |
push(lines[l[6]][2].."<-"..l[2]) | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main { | |
print "digraph G {" | |
i := 0 | |
filter {|a|[ #a > 0 ]} | split sep="\t" | try for n, word, base, type, form, _, ref, relation, _, _ do | |
i ++ if [ n = "1" ] | |
word ~= `\\`, `\\\\`, `"`, `\\"` | |
print "\t", `a${i}t$n [label="$word"];` | |
print "\t", `a${i}t$n -> a${i}t$ref [label="$relation"];` | |
done | |
print "}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ toRödaObj := require("json").jsonToRödaObj } | |
getadjs cat, token { | |
obj := toRödaObj(json([loadResourceLines("https://en.wiktionary.org/w/api.php?action=query&list=categorymembers&cmtitle=Category:"..cat.."&cmlimit=500&format=json&cmcontinue="..token)]&" ")) | |
for adj in obj["query"]["categorymembers"] do | |
STDOUT.push adj["title"], "\n" | |
done | |
return obj["continue"]["cmcontinue"] if [obj["continue"]?] else return "" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Radio Gem</title> | |
<meta name="description" content="Tekoälyn toimittama radiokanava." /> | |
<meta content="width=device-width, initial-scale=1,maximum-scale=1, user-scalable=no" name="viewport"> | |
<style> | |
html { | |
box-sizing: border-box; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
irc := require("irc_client") | |
SERVER := "irc.freenode.net" | |
CHANNELS := ["#kissachann"] | |
} | |
urlencode text { | |
return [ | |
chars(text) | for c do | |
push(c) if [ c =~ "(?i)[a-z.!'\\-]" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* commands.röd */ | |
/* by fergusq */ | |
/* | |
* This does two things: | |
* - It creates a couple of functions for every command in $PATH. | |
* - It modifies the cd function to update the prompt to show the current working directory. | |
* | |
* Every command function name has this format: <in><out>'<name> | |
* <in> and <out> can both be zero or one letter long. <name> is the name of the command. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<language id="roda" _name="Röda" version="2.0" _section="Script"> | |
<metadata> | |
<property name="mimetypes">text/x-roeda;application/x-roda</property> | |
<property name="globs">*.röd</property> | |
<property name="block-comment-start">/*</property> | |
<property name="block-comment-end">*/</property> | |
</metadata> | |
<styles> | |
<style id="comment" _name="Comment" map-to="def:comment"/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my %objs = (); | |
while (<>) { | |
s/#.*//; | |
s/\s//g; | |
unless (/^$/) { | |
die "syntax error" unless (/^[0-9]+<(\+|-|>|\[[0-9]+|]|\.)*$/); | |
my ($name, $code) = split(/</); | |
$objs{$name} = [0, $code]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main file { | |
readLines(file) | for line do | |
line ~= "#.*", "", "\\s+", "" | |
if [ line =~ "[0-9]+<(\\+|-|>|\\[[0-9]+|]|\\.)*" ] do | |
interpretDeclaration(line) | |
else | |
error("syntax error: ", line, "\n") unless [ line = "" ] | |
done | |
done | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\define{\Alku{nimi}{aika}{paikka}{pvm}}{<html> | |
<head> | |
<title>\nimi</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<style> | |
ol { | |
list-style-type: none; | |
counter-reset: item; | |
margin: 0; | |
padding: 0; |