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
function uvenv --description "Creates or loads an uv virtual environment." | |
argparse 'p/python=' 'l/local' 'y/yes' 'h/help' -- $argv | |
or return 1 | |
set env_file ".python-uversion" | |
# Handle help request | |
if set -q _flag_help | |
_uvenv_print_help $env_file | |
return 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
\documentclass[tikz]{standalone} | |
\usepackage{amsmath} | |
\usepackage{bm} | |
\usepackage{tikz} | |
\usepackage{pgfplots} | |
\usetikzlibrary{arrows.meta} | |
\usetikzlibrary{backgrounds} | |
\usetikzlibrary{calc} | |
\usetikzlibrary{fit} | |
\usetikzlibrary{positioning} |
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 <SDL2/SDL.h> | |
int main(void) { | |
SDL_Init(SDL_INIT_EVERYTHING); | |
SDL_GameControllerAddMappingsFromFile("gamecontrollerdb.txt"); | |
SDL_Window *window = SDL_CreateWindow("Controllers", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN); | |
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC); | |
SDL_bool is_running = SDL_TRUE; | |
SDL_GameController *ctrl; |
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 <stdint.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
#include <SDL2/SDL.h> | |
/* | |
* | |
* STRUCTS, Enums and Typedefs | |
* | |
*/ |
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 <SDL2/SDL.h> | |
void list_joysticks(); | |
int main(void) { | |
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO); | |
int sdl_flags = SDL_INIT_JOYSTICK; | |
int is_running = 1; | |
SDL_Init(sdl_flags); |
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
int dump_texture_to_file(SDL_Renderer *renderer, SDL_Texture *texture, const char *filename) | |
{ | |
SDL_Log("%s: ENTERING\n", __func__); | |
Uint32 format = 0; | |
int access = 0; | |
int width = 0; | |
int height = 0; | |
int retval = 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
void dump_texture_to_file(SDL_Renderer *renderer, SDL_Texture *texture, const char *filename) | |
{ | |
SDL_Log("%s: ENTERING\n", __func__); | |
Uint32 format; | |
int access; | |
int width; | |
int height; | |
SDL_QueryTexture(texture, &format, &access, &width, &height); |
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 <SDL2/SDL.h> | |
int main(void) { | |
SDL_bool quit = SDL_FALSE; | |
SDL_Init(SDL_INIT_VIDEO); | |
SDL_Window *window = SDL_CreateWindow("Mouse events", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_SHOWN); | |
SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); | |
SDL_SetRenderDrawColor(renderer, 127, 127, 127, 255); | |
SDL_RenderClear(renderer); | |
SDL_Event event; |
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 <stdint.h> | |
#include <glib.h> | |
#include <gmodule.h> | |
struct entity { | |
int32_t value; // 4 bytes | |
char name[12]; // 12 bytes | |
}; | |
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 <glib.h> | |
#include <glib/gi18n.h> | |
#include <stdint.h> | |
#include <stdbool.h> | |
#include <stdlib.h> | |
typedef int32_t i32; | |
// A sample object data | |
struct data |
NewerOlder