Skip to content

Instantly share code, notes, and snippets.

@oliverepper
oliverepper / Main.hs
Created October 7, 2024 06:14
ListViewDemo
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeApplications #-}
module Main where
import qualified GI.Gtk as Gtk
import qualified GI.Gio as Gio
import qualified GI.GLib as GLib
import qualified GI.GObject as GObject
import Data.GI.Base
import System.Exit
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
import Foundation
protocol Initializable {
init()
}
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
import Foundation
protocol Receiver<T> {
associatedtype T
func setValue(_ value: T)
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
#include <thread>
#include <vector>
auto new_thread() {
return [](auto p) {
std::thread { [p=std::move(p)]() mutable {
#include <thread>
auto async_work() {
return [](auto p) {
std::thread { [p=std::move(p)]() mutable {
std::exception_ptr ep;
try {
throw std::runtime_error("Test Error");
} catch (...) {
ep = std::current_exception();
/*
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms
*/
#include <iostream>
#include <thread>
using namespace std;
auto new_thread() {
return [](auto p) {
//
// BikeRRUITests.swift
// BikeRRUITests
//
// Created by Oliver Epper on 14.08.21.
//
// swiftlint:disable all
import XCTest
#include <iostream>
#include <asio.hpp>
#include <array>
using asio::ip::tcp;
using asio::buffer;
void handle_with_future(tcp::socket& client)
{
std::future<std::size_t> bytes_written = client.async_write_some(buffer("Welcome to my nightmare\n"), asio::use_future);
import Foundation
struct Output: TextOutputStream {
mutating func write(_ string: String) {
print(string, terminator: "")
}
}
protocol Drawable {
func draw_(out: inout Output, position: Int)