Skip to content

Instantly share code, notes, and snippets.

View mrryanjohnston's full-sized avatar
😎
Set your status

Ryan Johnston mrryanjohnston

😎
Set your status
View GitHub Profile
(deftemplate MAIN::meta-fact
(slot meta-fact)
(slot name))
(defrule MAIN::loop
?nil-meta-fact <- (meta-fact (meta-fact nil))
?announce-meta-fact <- (meta-fact (name ?name))
(not (meta-fact (meta-fact ?announce-meta-fact)))
=>
(println "Meta-fact: " ?name)
(deffunction say_hello (?name) do
(format t "Hello, %s!" ?name))
@mrryanjohnston
mrryanjohnston / README.md
Last active August 9, 2024 15:14
Better syntax highlighting for CLIPS in vim in Ubuntu

Slightly better syntax highlighting for CLIPS in vim (in Ubuntu)

Problem

Syntax highlighting is so-so for .clp files. vim, my favorite code editor, detects these filetypes as jess, an unmaintained Rules Engine with a similar syntax to CLIPS.

Adding the jess.vim file to ~/.vim/after/syntax/ and the default.vim file to ~/.vim/colors in your Ubuntu system will provide slightly better highlighting when editing CLIPS files

@mrryanjohnston
mrryanjohnston / info.txt
Last active April 9, 2024 22:09
Turbo Baker 9001 - A Cookie Clicker Steam Mod
{
"Name": "Turbo Baker 9001",
"ID": "TurboBaker9001",
"Author": "ryjo",
"Description": "A mod that lets you bake any amount of cookies on demand! I made this. ryjo.",
"ModVersion": 1,
"GameVersion": 2.052,
"Date": "04/01/2024",
"Dependencies": [],
"Disabled": 0,
@mrryanjohnston
mrryanjohnston / README.md
Last active June 28, 2023 13:57
Compiling CLIPS to WASM

Compiling CLIPS to WASM

Description

I used this process to compile a WASM file for CLIPS. This allows me to run CLIPS in the browser! I use this for the Tour of CLIPS I created.

How to Use

@mrryanjohnston
mrryanjohnston / README.md
Last active August 1, 2021 17:54
CLIPS Solution: The Hunger Games - Zoo Disaster!

The Hunger Games - Zoo Disaster!

Implements the algorithm described here using CLIPS.

@mrryanjohnston
mrryanjohnston / README.md
Created May 2, 2021 17:33
CLIPS - GET and print to STDIO with curl

CLIPS - curl to STDIO

Usage

(curl "https://ryjo.codes")

outputs to STDIO (as of 05/02/2021):

@mrryanjohnston
mrryanjohnston / main.c
Created March 19, 2021 14:59
clips-redis
#include "clips.h"
#include <hiredis.h>
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
void INThandler(int sig);
/****************************************/
/* main: Starts execution of the expert */
@mrryanjohnston
mrryanjohnston / Makefile
Last active February 19, 2021 05:27
ezpzPubSub
all: publish resubscribe server subscribe unsubscribe
publish:
gcc publish.c -lrt -o publish
resubscribe:
gcc resubscribe.c -lrt -o resubscribe
server:
gcc server.c -lpthread -lrt -o server
subscribe:
gcc subscribe.c -lrt -o subscribe
@mrryanjohnston
mrryanjohnston / Makefile
Created February 13, 2021 05:11
Learning C: pthread and mqueue
all:
gcc main.c -lpthread -lrt