Skip to content

Instantly share code, notes, and snippets.

View L0laapk3's full-sized avatar

L0laapk3 L0laapk3

View GitHub Profile
@L0laapk3
L0laapk3 / CMakeLists.txt
Created May 5, 2024 18:33
SFML borderless flickering issue
cmake_minimum_required(VERSION 3.16)
project(WindowTest LANGUAGES CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
include(FetchContent)
FetchContent_Declare(SFML
GIT_REPOSITORY [email protected]:SFML/SFML.git
GIT_TAG 2386653
@L0laapk3
L0laapk3 / autohotkey vjoy
Last active July 14, 2023 20:46
Example usage of the vjoy library with autohotkey
#SingleInstance Force
#DllLoad "C:\Program Files\vJoy\x64\vJoyInterface.dll"
; I configured vjoy to only have the X axis, all the other buttons etc turned off
GAME_NAME := "YOUR GAME HERE"
RID := 1
AXIS := 48 ; X axis, starts at 48 for whatever reason
#include <vector>
#include <benchmark/benchmark.h>
#include <limits>
#include <random>
#include <chrono>
#include <iostream>
// based on https://github.com/BUHPCv2/PerfDemo/blob/master/CacheBench.cpp
@L0laapk3
L0laapk3 / fireworks.lua
Last active August 9, 2022 17:46
computercraft fireworks screensaver animation
-- Fireworks screensaver animation
-- By L0laapk3, based on Rectar's Fireworks
launchRate = 0.03
fireworks = {}
particles = {}
fcolors={1,2,4,8,16,32,64,512,1024,2048,8192,16384}
particleChars = {"#","X","+","*","."}
@L0laapk3
L0laapk3 / pos.lua
Created August 6, 2022 16:14
computercraft turtle position tracker
local V = vector.new
local R = function(v, r)
local f = r > 1 and -1 or 1
if r % 2 == 1 then
return V(-v.z * f, v.y, v.x * f)
end
return V(v.x * f, v.y, v.z * f)
end
@L0laapk3
L0laapk3 / fancySphere.txt
Created February 28, 2022 19:47
Sphere points, fancy (277 points)
// https://github.com/L0laapk3/CrystalBot_RL/blob/0e8f2fa9eda91da9b39efb9ae1106ff0942eafdc/src/utils/renderBall.cpp
95.4872, 0, 0
91.422, 27.5648, 0
77.965, 55.1296, 0
55.1296, 77.965, 0
27.5648, 91.422, 0
0, 95.4872, 0
0, 91.422, 27.5648
0, 77.965, 55.1296
0, 55.1296, 77.965
@L0laapk3
L0laapk3 / cheapSphere.txt
Last active February 28, 2022 19:47
Sphere points, cheap (109 points)
// as generated by https://github.com/L0laapk3/CrystalBot_RL/blob/0e8f2fa9eda91da9b39efb9ae1106ff0942eafdc/src/utils/renderBall.cpp
95.4872, 0, 0
85.2728, 42.9692, 0
42.9692, 85.2728, 0
0, 95.4872, 0
0, 85.2728, 42.9692
0, 42.9692, 85.2728
0, 0, 95.4872
0, -42.9692, 85.2728
0, -85.2728, 42.9692
#include "utils/renderBall.h"
#include "utils/bridge.h"
#include <array>
#include <iostream>
constexpr float M_PI = 3.14159265358979323846;
void renderCircle(RLURenderer& renderer, const vec3& center, float radius, const vec3& axis, const size_t numPoints, rlbot::Color color) {
@L0laapk3
L0laapk3 / kicad_pcb_sort.py
Last active December 21, 2021 13:48
Easy placement of kicad components calculated from reference number. example for SN410501N
import re
file = "kicad/7seg_clock.kicad_pcb"
def place(m):
ref = int(m.group(3)) - 1
x = ref // 10
y = ref % 10
x *= 25.25
// ==UserScript==
// @name yare.io less delay
// @namespace http://tampermonkey.net/
// @version 1.0
// @author L0laapk3
// @match yare.io/d1/*
// @run-at document-idle
// @grant none
// ==/UserScript==