All New

user:thomas gists created by user

title:mygist gists with given title

filename:myfile.txt gists having files with given name

extension:yml gists having files with given extension

language:go gists having files with given language

topic:homelab gists with given topic

Register

Login


All New Register Login

All gists

Recently created
Least recently created
Recently updated
Least recently updated
capitalex's Avatar

capitalex / properties.ml

0 likes
0 forks
1 files
Last active 3 months ago
1 module Univ = struct
2 type t = ..
3 let id =
4 let id = ref 0 in
5 fun () ->
6 incr id ;
7 !id
8
9 module Embed (M : sig type t end) = struct
10 type t += E of M.t
capitalex's Avatar

capitalex / simple-object.lua

0 likes
0 forks
1 files
Last active 3 months ago
1 return function(animation, x, y)
2 local object = {
3 x = x
4 , y = y
5 , frame = 0
6 , animation = animation
7 , grabbed = false
8 }
9 function object:draw()
10 if mouseIsPressed and not taken and self:contains(mouseX, mouseY) and not self.grabbed then
capitalex's Avatar

capitalex / andpile

0 likes
0 forks
1 files
Last active 3 months ago
1 #!/usr/bin/env bash
2
3 if [[ ! -d "$HOME/.andpile" ]]; then
4 mkdir "$HOME/.andpile" ;
5 mkdir "$HOME/.andpile/data" ;
6 touch "$HOME/.andpile/feeds.txt" ;
7 fi
8
9 remove_feed() {
10 sed -i.back "$(($1 + 1))d" "$HOME/.andpile/feeds.txt" ;
capitalex's Avatar

capitalex / cat.cr

0 likes
0 forks
1 files
Last active 3 months ago
1 macro concat(*values)
2 {% top = -1 %}
3 {% for value, i in values %}
4 {% if value.is_a? ProcLiteral %}
5 {% new_top = top - value.args.size + 1 %}
6 %var{new_top} = {{value}}.call({% for arg, j in value.args %}
7 %var{top - (value.args.size - j - 1)},
8 {% end %})
9 {% top = new_top %}
10 {% elsif value.is_a? Call %}
capitalex's Avatar

capitalex / Calculator

0 likes
0 forks
1 files
Last active 4 months ago
Calculator implementing Bogue
1 open Bogue
2
3 module W = Widget
4 module L = Layout
5
6
7 let calculator () =
8 let stack = Stack.create () in
9 Stack.push "0" stack ;
capitalex's Avatar

capitalex / gol.ocaml

0 likes
0 forks
1 files
Last active 4 months ago
1 Random.self_init ()
2
3 type cell = Dead | Alive
4 let cell_to_string = function
5 | Alive -> "#"
6 | Dead -> "_"
7
8 let cell_to_int = function
9 | Alive -> 1
10 | Dead -> 0
capitalex's Avatar

capitalex / scheming.squirm

0 likes
0 forks
1 files
Last active 4 months ago
1 <quick ~color ~animalA jumps over the lazy ~animalB> {
2 How rude says !animalB to the quick !color !animalA
3 }
4
5 ~animalB {
6 lazy ~ {
7 $stash the ~ {
8 $stash over ~ {
9 $stash jump ~ {
10 $stash ~animalA {
capitalex's Avatar

capitalex / snarl.factor

0 likes
0 forks
1 files
Last active 4 months ago
1 ! Copyright (C) 2026 CapitalEx
2 ! This mine and only mine all rights reserved >:3c
3 USING: accessors assocs assocs.extras combinators
4 combinators.short-circuit command-line continuations debugger
5 html.elements io io.directories io.encodings.utf8 io.files
6 io.files.info io.pathnames io.streams.string kernel literals
7 namespaces sbufs sequences sequences.deep sets sorting splitting
8 strings unicode xml xml.data xml.state xml.traversal xml.writer
9 ;
10 FROM: namespaces => set ;
capitalex's Avatar

capitalex / progress.gd

0 likes
0 forks
2 files
Last active 5 months ago
1 extends RefCounted
2
3 var state = { "foo": ["foo", "bar", "baz", "quux"], "bar": ["quux", "baz", "bar", "foo"] }
4
5 func push(stack_symbol, symbol) -> void:
6 state[stack_symbol].push_back(symbol)
7
8 func peek(stack_symbol, depth : int, symbol) -> bool:
9 var stack = state[stack_symbol]
10 if not stack: return false
yumaikas's Avatar

yumaikas / quotationBuilder.zig

0 likes
0 forks
1 files
Last active 5 months ago
1 const QuotationBuilder = struct {
2 symbols: std.ArrayList(vm.Symbol),
3 ops: std.ArrayList(vm.Op),
4 literals: std.ArrayList(vm.Value),
5 alloc: std.mem.Allocator,
6 postQuoteSymbol: ?vm.Symbol,
7
8 fn idxForLiteral(self: *QuotationBuilder, toFind: struct {vm.Value, *bool }) !u16 {
9 const literal, const found = toFind;
10 for (self.literals.items, 0..) |i,idx| {
Newer Older

Powered by Opengist ⋅ Load: 250ms⋅

English
Čeština Deutsch English Español Français Magyar Italiano 日本語 Polski Português Русский Türkçe Українська 中文 繁體中文