Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
💾

Fırat Salgür neuro-sys

💭
💾
View GitHub Profile
@neuro-sys
neuro-sys / Xorg
Created Nov 10, 2021
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
neuro-sys / Dockerfile
Last active Nov 9, 2021
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 https://deb.nodesource.com/setup_14.x | bash - && \
apt-get install -y nodejs
# See: https://github.com/stackgl/headless-gl#ubuntudebian
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
View mandelbrot.fs
vocabulary mandelbrot.fs also mandelbrot.fs
require sdl.fs
also sdl.fs
\ z = z^2 + c
\ z = x0 + iy0
\ z^2 = (x + iy)(x + iy)
\ = x^2 + 2xiy + (iy)^2
\ = x^2 + 2xiy - y^2
View cube.obj
v -1.000000 -1.000000 1.000000
v -1.000000 1.000000 1.000000
v -1.000000 -1.000000 -1.000000
v -1.000000 1.000000 -1.000000
v 1.000000 -1.000000 1.000000
v 1.000000 1.000000 1.000000
v 1.000000 -1.000000 -1.000000
v 1.000000 1.000000 -1.000000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
@neuro-sys
neuro-sys / vec.fs
Last active Mar 7, 2021
fixed point vector operations
View vec.fs
0 warnings !
vocabulary f8
f8 definitions
\ fixed point 8.8 conversion
: d>f8 ( d -- f8 ) 256 * ;
: f8>d ( f8 -- d ) 256 / ;
View tran1.asm
; Transition effect 1
nolist
org #7000
jp start
fc ds 1 ; frame count
y1 ds 2 ; y pos counter
y2 ds 2 ; upper bound position
y3 ds 2 ; lower bound
View multable.c
1 2 3 4 5 6 7 8 9
--- --- --- --- --- --- --- --- ---
1 | 1 2 3 4 5 6 7 8 9
2 | 2 4 6 8 10 12 14 16 18
3 | 3 6 9 12 15 18 21 24 27
4 | 4 8 12 16 20 24 28 32 36
5 | 5 10 15 20 25 30 35 41 45
6 | 6 12 18 24 30 36 42 48 54
7 | 7 14 21 28 35 42 49 56 63
8 | 8 16 24 32 41 48 56 65 72
View day1.0-v1.fs
\ Advent of Code 2020 day 1.0
include reader.fs
: 2020? + 2020 = ; \ true if sum is equal to 2020
: find-pair-j ( uaddr1 uaddr2 -- uaddr3 uaddr4 t )
begin
dup list->end? invert
while
View sierpinski.asm
BITS 16
org 0x100
;-----------------------------------------------------------------------+
; Set up mode 13h, and screen address at es:di
;-----------------------------------------------------------------------+
mov al, 13h
int 0x10
;-----------------------------------------------------------------------+