Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
'''
This program is used to attach a file to a defect in HPQC.
'''
import requests
from requests import Request, Session
from requests.auth import HTTPBasicAuth
import json,io
@niuniulla
niuniulla / SDL_recording_playback.cpp
Last active March 29, 2024 22:33
A minimal implementation of audio recording and playback using SDL2.
/*
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages arising
from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely.
*/
/*
@niuniulla
niuniulla / sdl_whispercpp.cpp
Created February 21, 2024 05:06
A minimal use case of SDL Audio and whisper.cpp
/*
A minimal use case of SDL Audio and whisper.cpp
*/
/*
The program, upon launch, record a piece of recording of up to
1 minute and transcribe it into text on the terminal.
For more info on whipser.cpp: https://github.com/ggerganov/whisper.cpp/blob/master/CMakeLists.txt
*/
#include <SDL2/SDL.h>
@niuniulla
niuniulla / image2pixelsSDL.cpp
Created March 12, 2024 21:09
Example of image loading to pixels and display using SDL
/*
Example of image loading to pixels and display using SDL
The program is a minimal implementation of image loading
using SDL and display it on a window. It creates first a
surface and retrieves the pixels from the last. Then it
updates the texture using the pixels and area of the image.
*/
@niuniulla
niuniulla / square_eater.cpp
Created March 18, 2024 19:36
A simple game example using X11.
/*
Simple game example using X11.
*/
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xos.h>
#include <iostream>
#include <unistd.h>
@niuniulla
niuniulla / dearpygui_nodes.py
Created May 7, 2024 19:42
A minimal example to show the usage of dearpygui to construct an nodes app.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a minimal example to show the usage of dearpygui
to construct an app of nodes manipulations.
The basic functions includ:
* drag a button to create a node
* change node theme
* show some message based on the selected node