Skip to content

Instantly share code, notes, and snippets.

View pepe's full-sized avatar

Josef Pospíšil pepe

View GitHub Profile
@sogaiu
sogaiu / linux_home_local_config.janet
Last active August 29, 2021 22:48
jpm config file and instructions for "things under ~/.local"
# new instructions here
#
# 0. assuming a janet install with `make clean && PREFIX=$HOME/.local make && PREFIX=$HOME/.local make install`
# 1. git clone https://github.com/janet-lang/jpm
# 2. PREFIX=$HOME/.local janet bootstrap.janet
#
# alternatively, from a clone of the janet repository:
#
# 0. assuming a janet install with `make clean && PREFIX=$HOME/.local make && PREFIX=$HOME/.local make install`
# 1. PREFIX=$HOME/.local make install-jpm-git
@bakpakin
bakpakin / dagbuild.janet
Created June 11, 2021 19:13
Parallel, make-like builds - work for adding parallel builds to jpm
###
### dagbuild.janet
###
### A module for building files / running commands in an order.
### Building blocks for a Make-like build system.
###
#
# DAG Execution
#
@dz4k
dz4k / Draggable._hs
Last active December 25, 2023 10:47
Draggable window in _hyperscript
-- Usage: _="install Draggable(dragHandle: .titlebar in me)"
behavior Draggable(dragHandle)
init
if no dragHandle set the dragHandle to me
end
on pointerdown(clientX, clientY) from dragHandle
halt the event
trigger draggable:start -- hooks, e.g. for adding a drop shadow while dragging
measure my x, y
@sogaiu
sogaiu / debug.janet
Last active February 23, 2021 03:34
scratch work for a janet source debugger
(var steps 0)
(defn my-repl
[the-syms]
(def chunks
(fn [buf p]
(getline (string/format "\nrecent: %p\nsteps: %d\n> "
(keys the-syms) steps)
buf the-syms)))
#
@ityonemo
ityonemo / test.md
Last active April 25, 2024 10:23
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

(defmacro
defclass
`
Define a CLOS-style class.
`
[name parent & attributes]
(def forms @[])
(let [init-args @[]
names-with-defaults (mapcat |[(keyword ($0 0)) (($0 1) :default)]
attributes)]
@felixr
felixr / janet_repos.md
Last active September 28, 2021 01:58
janet repos
URL Stars Created
http://github.com/ahungry/ahungry-janet 3 2020-05-29 02:54:07
http://github.com/ahungry/ahungry-janet-user 0 2020-05-29 04:28:45
http://github.com/ahungry/janet-code 8 2019-07-28 05:10:59
http://github.com/ahungry/janet-p99-map 1 2020-05-10 04:13:27
http://github.com/ahungry/janet-pobox 7 2020-05-27 04:36:08
http://github.com/ahungry/janet-xbuild 2 2020-05-28 14:17:09
http://github.com/ahungry/puny-gui 83 2020-04-24 02:52:59
http://github.com/ahungry/puny-server 1 2020-04-23 01:42:38
@sogaiu
sogaiu / print-related-in-janet.md
Last active December 8, 2020 07:21
various printing things in janet
@sogaiu
sogaiu / life-of-a-janet-expression.md
Last active December 20, 2023 10:39
the life of a janet expression
@sogaiu
sogaiu / janet_via_ctypes.py
Last active January 8, 2021 22:46
janet via python's ctypes
from ctypes import *
# macos may need .dylib
# windows may need WinDLL and .dll
dll = CDLL("./libjanet.so")
dll.janet_init()
# http://michas.eu/blog/c_ints.php?lang=en
# https://stackoverflow.com/a/13293860