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
neuro-sys / gist:6cfa2a605d82ca1ec96777d4b9081e1d
Created December 9, 2022 13:31
error : Precompiling failed
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:
//build.relexsolutions.com/dev-tools/nuget/'. 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]
C:\Users\Public\code\dotnet-wasm-todo-mvc\test\PlaywrightTests.csproj : warning NU1803: You are running the 'restore' operation with an 'HTTP' s
ource, 'http://build.relexsolutions.com/dev-tools/nuget/'. 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
neuro-sys / 11.joy
Last active December 2, 2022 20:13
Advent of Code 2022 in Joy
"seqlib" libload.
DEFINE
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
neuro-sys / locals.fd
Last active November 27, 2022 10:09
forth locals with vocabularies
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 )
: """s s\" \"\"\"s" ;
: s""" ( -- caddr u )
begin
refill 0= if exit then
source """s compare 0= if
refill drop ( ignore the line )
0 c, ( put zero terminator )
exit
then
@neuro-sys
neuro-sys / opengl-triangle.fs
Last active November 26, 2022 10:42
gforth opengl example
decimal
s" utils.fs" included
also utils
vocabulary main-gl
also main-gl definitions
640 constant #width
480 constant #height
0
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
0
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
neuro-sys / Xorg
Created November 10, 2021 12:20
Xorg 100% CPU bug
[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
neuro-sys / Dockerfile
Last active May 17, 2024 06:47
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.
# 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 https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# See: https://github.com/stackgl/headless-gl#ubuntudebian
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