- miniaudio, a single-header audio lib for C https://github.com/dr-soft/miniaudio
- fftw, discrete Fast Fourier Transform for C http://fftw.org/
cc jm.c -lxdo -lSDL2 -lm -o jm -O3
./jm
Only tested with an Xbox 360 Wireless Controller.
Default bindings:
- Left joystick - move cursor
- Right joystick - scroll
- A - left click
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## An SDL2 wrapper using nimterop. | |
import os | |
import nimterop/build | |
import nimterop/cimport | |
const | |
Base = getProjectCacheDir("sdl2") |
- WM: i3-gaps
- Wallpaper
- Font
- Compositor: compton-tryone
- Bar: polybar
- Terminal: alacritty
- rofi: default, looks good enough but I might customize at some point
Config files and scripts below.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import math | |
import os | |
import parseopt | |
import random | |
import strutils | |
import rapid/gfx | |
import rapid/res/textures | |
import rapid/res/images | |
import rapid/gfx/fxsurface |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <alsa/asoundlib.h> | |
#define LOG(...) do { \ | |
fprintf(stderr, __VA_ARGS__); \ | |
fflush(stderr); \ | |
} while (0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <alsa/asoundlib.h> | |
#include <math.h> | |
#include <unistd.h> | |
#include <xdo.h> | |
#define LOG(...) do { \ | |
fprintf(stderr, __VA_ARGS__); \ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local syntax = require "core.syntax" | |
local patterns = {} | |
local symbols = { | |
["nil"] = "literal", | |
["true"] = "literal", | |
["false"] = "literal", | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- MIT License | |
-- | |
-- Copyright (c) 2021 liquidev | |
-- | |
-- Permission is hereby granted, free of charge, to any person obtaining a copy | |
-- of this software and associated documentation files (the "Software"), to deal | |
-- in the Software without restriction, including without limitation the rights | |
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
-- copies of the Software, and to permit persons to whom the Software is | |
-- furnished to do so, subject to the following conditions: |
I've since moved the tutorial over to my website. Clarified some of the wording, added exercises at the end, added links to useful resources.
For historical reasons, I'm keeping the original text here. But if you've just stumbled upon this tutorial for the first time, you may want to check out the revised version!
https://riki.house/programming/lua/classes
OlderNewer