Skip to content

Instantly share code, notes, and snippets.

View neuro-sys's full-sized avatar

Fırat Salgür neuro-sys

View GitHub Profile
neuro-sys / gist:6cfa2a605d82ca1ec96777d4b9081e1d
Created December 9, 2022 13:31
error : Precompiling failed
View gist:6cfa2a605d82ca1ec96777d4b9081e1d
C:\Users\Public\code\dotnet-wasm-todo-mvc>dotnet publish -c Debug
MSBuild version 17.4.0+18d5aef85 for .NET
Determining projects to restore...
C:\Users\Public\code\dotnet-wasm-todo-mvc\TodoMVC.csproj : warning NU1803: You are running the 'restore' operation with an 'HTTP' source, 'http:
//'. Non-HTTPS access will be removed in a future version. Consider migrating to an 'HTTPS' source. [C:
C:\Users\Public\code\dotnet-wasm-todo-mvc\test\PlaywrightTests.csproj : warning NU1803: You are running the 'restore' operation with an 'HTTP' s
ource, ''. Non-HTTPS access will be removed in a future version. Consider migrating to an 'HTTPS
' source. [C:\Users\Public\code\dotnet-wasm-todo-mvc\TodoMVC.sln]
All projects are up-to-date for restore.
neuro-sys /
Last active December 2, 2022 20:13
Advent of Code 2022 in Joy
"seqlib" libload.
readlines == []
"1.txt" "ro" fopen
[feof not] [fgets rolldown cons swap] while
fclose reverse;
shiftleft == 10 * +;
chartoint == ord '0 ord -;
toint == 0 [chartoint swap shiftleft] fold;
neuro-sys / locals.fd
Last active November 27, 2022 10:09
forth locals with vocabularies
View locals.fd
vocabulary quadratic also quadratic definitions
vocabulary fdiscriminant also fdiscriminant definitions
fvariable a
fvariable b
fvariable c
previous definitions also fdiscriminant
\ calculate the discriminant (b^2 - 4ac)
: fdiscriminant ( a b c -- n )
View multi-line-string.fs
: """s s\" \"\"\"s" ;
: s""" ( -- caddr u )
refill 0= if exit then
source """s compare 0= if
refill drop ( ignore the line )
0 c, ( put zero terminator )
neuro-sys / opengl-triangle.fs
Last active November 26, 2022 10:42
gforth opengl example
View opengl-triangle.fs
s" utils.fs" included
also utils
vocabulary main-gl
also main-gl definitions
640 constant #width
480 constant #height
View adnd-1e.fs
dup constant minmax:min cell +
dup constant minmax:max cell +
constant minmax
\ The first element of each ability should be ability-score
0 constant ability-score
dup constant str:ability-score minmax +

s" lib.fs" included ...

This file is valid Forth source code, but also a Markdown file thanks to Forth allowing to define new syntax. Anything outside fenced code blocks will be skipped by the Forth compiler/interpreter. This allows code to be written in the literate programming style.

Day 1, Part 1

neuro-sys / Xorg
Created November 10, 2021 12:20
Xorg 100% CPU bug
View Xorg
[199198.933] (II) Initializing extension XKEYBOARD
[199198.934] (II) Initializing extension XC-MISC
[199198.934] (II) Initializing extension SECURITY
[199198.934] (II) Initializing extension XFIXES
[199198.934] (II) Initializing extension RENDER
[199198.934] (II) Initializing extension RANDR
[199198.934] (II) Initializing extension COMPOSITE
[199198.934] (II) Initializing extension DAMAGE
[199198.934] (II) Initializing extension MIT-SCREEN-SAVER
[199198.934] (II) Initializing extension DOUBLE-BUFFER
neuro-sys / Dockerfile
Last active May 2, 2023 00:54
Dockerfile for headless-gl. You also need to run Docker container in "privileged" mode, assign X11 auth volume on the container, and possibly give Xauth access for call from outside.
View Dockerfile
# Build stage
FROM nvidia/opengl:1.0-glvnd-devel-ubuntu20.04 as builder
# Install node 14.0
RUN apt-get update -y && \
apt-get install -y curl gnupg ca-certificates && \
curl -sL | bash - && \
apt-get install -y nodejs
# See:
View example.fs
marker new
\ dev words
: edit s" emacs -Q example.fs" system new s" example.fs" included ;
\ internal words
variable dp1 \ backup for dp
variable sdp here 100000 + sdp ! \ string dp