Skip to content

Instantly share code, notes, and snippets.

@ancientstraits
ancientstraits / Makefile
Created June 2, 2021 04:29
Quick OpenGL tutorial
# For video https://youtu.be/7_0ZqdPqQ1I
OBJS = $(patsubst src/%.c, obj/%.o, $(wildcard src/*.c))
CFLAGS = -Iinclude -g -ggdb `pkg-config --cflags glfw3 glew`
LIBS = `pkg-config --libs glfw3 glew` -lm
DEPS = $(wildcard include/*.h)
EXEC = main
obj/%.o: src/%.c $(DEPS)
$(CC) -o $@ -c $< $(CFLAGS)
<nav>
<ul id="links">
<li><a href="#">Lorem.</a></li>
<li><a href="#">Consequuntur.</a></li>
<li><a href="#">Reiciendis.</a></li>
<li><a href="#">Qui.</a></li>
<li><a href="#">Necessitatibus!</a></li>
</ul>
</nav>
<nav>
<ul id="links">
<li><a href="#">Lorem.</a></li>
<li><a href="#">Consequuntur.</a></li>
<li><a href="#">Reiciendis.</a></li>
<li><a href="#">Qui.</a></li>
<li><a href="#">Necessitatibus!</a></li>
</ul>
</nav>
<nav>
<div id=cont>
<ul id="logo">
<li><a href="/">Lorem.</a></li>
</ul>
<label for="menuButton">&#9776;</label>
</div>
<input type="checkbox" id = "menuButton">
<ul id="navbar">
@ancientstraits
ancientstraits / gitpod_vnc.sh
Last active September 16, 2021 12:08
Install VNC on gitpod
#!/bin/sh
# This script easily gives gitpod graphical
# capabilities by using tightvncserver and noVNC.
# To be lightweight, it also uses awesomeWM as the
# graphical environment, but you can change it
# by editing this script.
# Package management
sudo apt update
I ran the program 3 times.
1st run:
Bubble Sort No Temp: 1.147000 ms (4.779167 μs per 240 iterations)
Bubble Sort With Temp: 0.963000 ms (4.012500 μs per 240 iterations)
2nd run:
Bubble Sort No Temp: 1.134000 ms (4.685950 μs per 242 iterations)
Bubble Sort With Temp: 0.980000 ms (4.049587 μs per 242 iterations)
@ancientstraits
ancientstraits / build.sh
Created March 30, 2022 19:15
build.sh: An alternative to a Makefile which also creates a `compile_commands.json`. Has MIT License
#!/bin/bash
# The build script for the program
# Paths
[ -z $SRC ] && SRC='src'
[ -z $INC ] && INC='inc'
[ -z $OBJ ] && OBJ='obj'
[ -z $EXEC ] && EXEC='main'
local cm = require('codim')
-- An animation is a function that takes time in and returns an image.
local function logo(props, time)
if time.seconds <= props.seconds then
return cm.text {
location = cm.position.center,
color = white,
}
else
@ancientstraits
ancientstraits / print_all_args.asm
Created May 12, 2022 12:42
print all arguments in x64 asm
global main
extern puts
main:
push rbp
mov rbx, rdi
.loop:
push rsi
mov rdi, [rsi]