Skip to content

Instantly share code, notes, and snippets.

View paulfrische's full-sized avatar
🍕

Paul paulfrische

🍕
View GitHub Profile
@paulfrische
paulfrische / client.py
Created July 19, 2023 10:49
dirty implementation of "multiplayer" in pygame with sockets
import pygame
import socket
import threading
ADDRESS = ('127.0.0.1', 8000)
position1 = (0, 0)
position2 = (0, 0)
pygame.init()
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'dracula/tmux'
# fix colors in neovim
set -g default-terminal "screen-256color"
set -ga terminal-overrides ",xterm-256color*:Tc"
# set prefix
set -g prefix C-a
@paulfrische
paulfrische / ogl_triangle.rs
Created October 7, 2022 18:39
Hello World OpenGL Triangle in Rust
extern crate glfw;
extern crate gl;
use glfw::{Action, Context, Key};
use std::{os::raw::*, ffi::CString, ptr, mem};
fn main() {
let vertex_shader_source = String::from("
#version 330 core
@paulfrische
paulfrische / ogl_triangle.cpp
Created October 2, 2022 20:07
first triangle in opengl
#include <iostream>
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
const char *vertex_shader_source =
"#version 330 core\n"
"layout (location = 0) in vec3 pos;\n"
@paulfrische
paulfrische / http_server.py
Created July 18, 2022 10:26
A very simple http server which always returns "lol" as response
import socket
HOST = "127.0.0.1"
PORT = 8080
RESPONSE = """HTTP/1.1 200 OK
Content-Length: 3
Content-Type: text/plain
lol"""