This file contains hidden or 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
# This is an example of how to use SDL in Janet using the FFI module. | |
# This is based on Lazy Foo's tutorial that can be found at: | |
# https://lazyfoo.net/tutorials/SDL/01_hello_SDL/index2.php | |
# | |
# In order to run this, you need: | |
# - To have libSDL2.so at the same folder where the source code is. | |
# - Create three separate files, as descibed by the comments below. | |
# - Read the FFI docs here: | |
# https://janet-lang.org/1.25.1/docs/ffi.html | |
# |
This file contains hidden or 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
;; I had to create a Table of Contents component for my personal site, and in | |
;; order to do that I had to scan all headings in the document (using .querySelectorAll) | |
;; and transform them into a list of maps that I could use to nest them properly. | |
;; The idea is to get a plain vector of nodes created using `make-node` and return | |
;; a tree in which nodes are nested according to their level. | |
(defn make-node | |
"Creates the representation of an HTML heading. You can search for all headings | |
in your document and convert them to this structure." | |
[tag-name tag-level value] |
This file contains hidden or 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
# This code is ugly and slow, just a reference. | |
# But is works (mostly) | |
from __future__ import annotations | |
from dataclasses import dataclass | |
from typing import Tuple | |
import pygame.draw | |
from pygame import Surface |
This file contains hidden or 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
{ | |
"transfer": "AAAAA", | |
"transaction_feed": "BBBBB", | |
"change_name": "CCCCC" | |
} |
This file contains hidden or 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
(ns dev.danodic.log | |
"A simple module with mutable data structures. Used to create logs grouped | |
by discrete elements, like files. It was meant to be used as the logging | |
lib for rushbeat, but at this point I'm not sure if this is being used or | |
not. As it relies on refs, it is probably thread safe as well (did not | |
test this and at this point I'm a beginner at Clojure." | |
(:require [clj-time.local :as time]) | |
(:gen-class)) | |
; Stores the log entries |