Skip to content

Instantly share code, notes, and snippets.

View niansa's full-sized avatar

niansa/tuxifan niansa

View GitHub Profile
@niansa
niansa / main.cpp
Last active February 20, 2024 22:13
Steam Audio example
#include <iostream>
#include <fstream>
#include <vector>
#include <cstdint>
#include <phonon.h>
std::vector<float> load_input_audio(const char *filename) {
std::ifstream file(filename, std::ios::binary);
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("Hello world!")
Hello world!
>>>import huge_dictionary as dic
>>> res = dic.find("treehouse")
>>> res.description
'A treehouse is a structure built around, in, or on the trunk of a mature tree that can be used for recreation, leisure, work, or residence.'
>>>
#include "httpclient.hpp"
#include <cerrno>
coro::task<bool> HttpClient::send(std::string_view path, std::function<coro::task<bool> (std::span<const char>)> cb, const Headers& headers) {
co_await scheduler->schedule();
// Connect
class HttpClient {
std::shared_ptr<coro::io_scheduler> scheduler;
coro::net::ip_address addr;
std::string host;
uint16_t port = 80;
std::chrono::milliseconds timeout = std::chrono::milliseconds(5000);
public:
HttpClient(std::weak_ptr<coro::io_scheduler> sched) : scheduler(sched) {}
@niansa
niansa / gist:2b684cab7016001fdbe2d2c1c0cf3c7d
Created July 25, 2021 16:50
libcoro faileds build log
nils@lyllia:~/Programme/OSS/libcoro> mkdir Release && cd Release
nils@lyllia:~/Programme/OSS/libcoro/Release> cmake -DCMAKE_BUILD_TYPE=Release ..
-- The CXX compiler identification is GNU 11.1.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
libcoro /home/nils/Programme/OSS/libcoro -> git config --local core.hooksPath .githooks
libcoro LIBCORO_BUILD_TESTS = ON
This file has been truncated, but you can view the full file.
[11:16:14 pm] --> nisa (~quassel@pd9f9ad8d.dip0.t-ipconnect.de) has joined ##apocalypse
[11:16:15 pm] * Topic for ##apocalypse is "<rasengan> foss is forking. foss is building. foss is collaboration. <letty> foss is taking a lot of cocaine :: <girst> fuck you rasengan for destroying freenode <3"
[11:16:15 pm] * Topic set by Jigsy!~Jigsy@88-111-2-172.dynamic.dsl.as9105.com on 2021-06-15 21:11:55 UTC
[11:16:15 pm] *** Mode ##apocalypse +ns by capone.freenode.net
[11:16:15 pm] * Channel ##apocalypse created on 2021-06-15 20:52:40 UTC
[11:16:23 pm] <aeth> 17:16:05 [capone] -!- 51 57630 Current global users 51, max 57630
[11:16:25 pm] --> HeTo (henkka@beer.modeemi.fi) has joined ##apocalypse
[11:16:31 pm] <-> ChanServ is now known as Global
[11:16:31 pm] --> ar (~arachnist@host-185-102-189-133.jmdi.pl) has joined ##apocalypse
[11:16:33 pm] <-> Irydacea is now known as root
@niansa
niansa / Freenode drama
Last active June 16, 2021 12:21
Freenode drama
Bans:
Error from server: Closing link: (~quassel@p200300e447027500f64d30fffe69d8c4.dip0.t-ipconnect.de) [Killed (tau (can you not?))]
#freenode (from the good old Freenode net) (no context):
<@rasengan> THE SWAMP IS DRAINING
<-* rasengan has kicked Xavierdarkness from #freenode (stop talking about me)
<@rasengan> If you don't like it. become strong. get power. seriously stop whining. so weak.
#freenode (from the good old Freenode net) (with context):
<x_> rasengan: opinion? https://corrupt.tech/1708590130-ocr-compressed.pdf
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <limits.h>
#include <MiniFB.h>
#define WIDTH 800
#define HEIGHT 600
#define BOTTOM_LINE HEIGHT / 2
import os, io
from base64 import b64encode, b64decode
class itypes:
FILE = 1
DIRECTORY = 0
# READABLE WRITABLE APPENDS CREATES
FREAD_ONLY = "r" # YES NO NO NO
FREAD_WRITE = "r+" # YES YES NO NO
#include <iostream>
#include <map>
#include <cstdio>
#include <cstring>
#include <dlfcn.h>
#include <dirent.h>
#include <interpreter.h>
#include <module_builtin.h>
#include <environment.h>