Skip to content

Instantly share code, notes, and snippets.

View mkalte666's full-sized avatar

mkalte mkalte666

View GitHub Profile
// PlotLod has internal state, so keep it in your eframe app or somewhere else static
let lod = PlotLod(&file.large_data_set, 0.0, 10.0);
// and assign lod to Self somewhere
// #######
// #######
// down in the drawing department, i have something like this
egui::plot::Plot::new("Current")
.show(ui, |plot_ui| {
[[noreturn]] void backtraceAbort(int skip) noexcept
{
#ifdef SDL2WRAP_ENABLE_BACKTRACE_ABORT
std::fprintf(stderr, "Trying to Print Backtrace. \nThis might fail and crash, but after this point abort() is called anyway\n");
// caller might also ask to be skipped
// we do not want to print backtrace_abort hence +1
// also, dont use any c++ stuff as we might be trying to do things from near-death.
// honestly, calling malloc here is a stretch
skip += 1;
void* buffer[SDL2WRAP_BT_SIZE];
@mkalte666
mkalte666 / ptrclass.hpp
Last active May 25, 2019 22:34
Class that enforces somewhat sensible defaults for ptr-only classes (including create method)
// released as CC0
// Public Domain
#ifndef _ptrclass_h
#define _ptrclass_h
#include <memory>
/**
* \brief Parent struct that helps enforcing NoCopy rules
*/
#include "SDL.h"
#include <stdio.h>
#define SAMPLE_COUNT 4096
#define CHANNEL_COUNT 2
#define AUDIO_BUFFER_SIZE CHANNEL_COUNT*SAMPLE_COUNT
#define AUDIO_BUFFER_BYTES sizeof(short)*AUDIO_BUFFER_SIZE
int main(int argc, char** argv)
{
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select