Skip to content

Instantly share code, notes, and snippets.

Avatar

Michael Camilleri pyrmont

View GitHub Profile
View building-and-running-janet.md

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
A simple GitHub Actions workflow for CI testing with Janet
View build.yaml
name: build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
@pyrmont
pyrmont / deps.edn
Last active Feb 19, 2021
Figwheel setup with Conjure
View deps.edn
{: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 Jan 22, 2020
blog.danieljanus.pl Atom Feed
View feed.xml
<?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>dj@danieljanus.pl</a:email>
@pyrmont
pyrmont / core.cljs
Created Apr 3, 2019
Example CLJS file to be in src/foo/core.cljs
View 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 Mar 10, 2019
A list of unique, alphabetically sorted namespaces from the Google Closure Library
View Google Closure Library Namespaces
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 Nov 14, 2018
A script to generate an RSS feed for a Letterboxd watchlist.
View watchlist2rss.rb
@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 Sep 28, 2018
A 1Writer action for adding Jekyll frontmatter to a Markdown document.
View 1writer-format_for_jekyll.js
// 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 Sep 27, 2018
A 1Writer action for adding a reference link to a Markdown document.
View 1writer-add_reference_link.js
@pyrmont
pyrmont / 1writer-add_footnote.js
Created Sep 27, 2018
A 1Writer action for adding a footnote to a Markdown document.
View 1writer-add_footnote.js
// Main Steps
let text = editor.getText()
const range = editor.getSelectedRange()
const label = `[^0]`
text = insertFootnote(text, range[1], label)
text = reorderFootnotes(text)