Skip to content

Instantly share code, notes, and snippets.

View pyrmont's full-sized avatar

Michael Camilleri pyrmont

View GitHub Profile
@pyrmont
pyrmont / mrepl.fnl
Last active October 27, 2024 07:30
mREPL
(module conjure.client.janet.mrepl
{autoload {a conjure.aniseed.core
str conjure.aniseed.string
nvim conjure.aniseed.nvim
client conjure.client
config conjure.config
eval conjure.aniseed.eval
fennel conjure.aniseed.fennel
fs conjure.fs
log conjure.log

Building and Running janet

The janet binary is a combined REPL and runtime. The runtime includes a compiler that compiles Janet code on the fly before executing that code.

The janet binary is built from two C source files: an amalgamated file (janet.c) and a shell client (shell.c). These files can be compiled by any compatible C compiler.

The Amalgmation

The amalgamated file, janet.c, is not included in Janet's repository but is generated during the 'bootstrapping' phase of the Janet build process. The generation of the amalgamation involves two steps:

@pyrmont
pyrmont / build.yaml
Created May 21, 2020 17:43
A simple GitHub Actions workflow for CI testing with Janet
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@pyrmont
pyrmont / deps.edn
Last active January 27, 2022 05:27
Figwheel setup with Conjure
{:deps {org.clojure/clojure {:mvn/version "1.10.1"}
org.clojure/clojurescript {:mvn/version "1.10.597"}}
:paths ["src" "resources"]
:aliases {:fig {:extra-deps
{com.bhauman/rebel-readline-cljs {:mvn/version "0.1.4"}
com.bhauman/figwheel-main {:mvn/version "0.2.4"}}
:extra-paths ["target" "test"]}
:build {:main-opts ["-m" "figwheel.main" "-b" "dev" "-r"]}
:min {:main-opts ["-m" "figwheel.main" "-O" "advanced" "-bo" "dev"]}
:release {:main-opts ["-m" "figwheel.main" "-bo" "release"]}
@pyrmont
pyrmont / feed.xml
Created January 22, 2020 06:54
blog.danieljanus.pl Atom Feed
<?xml version="1.0" encoding="UTF-8"?>
<a:feed xmlns:a="http://www.w3.org/2005/Atom">
<a:id>tag:blog.danieljanus.pl,2019:feed</a:id>
<a:title>code · words · emotions: Daniel Janus’s blog</a:title>
<a:link href="http://blog.danieljanus.pl"/>
<a:updated>2020-01-21T00:00:00Z</a:updated>
<a:author>
<a:name>Daniel Janus</a:name>
<a:uri>http://danieljanus.pl</a:uri>
<a:email>[email protected]</a:email>
@pyrmont
pyrmont / core.cljs
Created April 3, 2019 18:17
Example CLJS file to be in src/foo/core.cljs
(ns foo.core
(:require clojure.string))
(defn try-it []
(clojure.string/trimr 1))
(defn try-it2 []
(clojure.string/triml 1))
(defn call-me []
@pyrmont
pyrmont / Google Closure Library Namespaces
Created March 10, 2019 05:35
A list of unique, alphabetically sorted namespaces from the Google Closure Library
goog.Delay
goog.Disposable
goog.History
goog.History.Event
goog.History.EventType
goog.Promise
goog.Thenable
goog.Throttle
goog.Timer
goog.Uri
@pyrmont
pyrmont / watchlist2rss.rb
Last active November 14, 2018 05:05
A script to generate an RSS feed for a Letterboxd watchlist.
@username = # Enter username as a String
# Editing below this line should not be required
require 'net/http'
require 'rss'
require 'uri'
class Watchlist
PATTERNS = {
@pyrmont
pyrmont / 1writer-format_for_jekyll.js
Created September 28, 2018 03:53
A 1Writer action for adding Jekyll frontmatter to a Markdown document.
// Main Steps
let text = editor.getText()
text = addFrontMatter(text)
text = removeTitle(text)
editor.setText(text)
moveCursor(text)
@pyrmont
pyrmont / 1writer-add_reference_link.js
Last active September 27, 2018 10:33
A 1Writer action for adding a reference link to a Markdown document.