This file contains 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
{-# 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 file contains 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
/* | |
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms | |
*/ | |
import Foundation | |
protocol Initializable { | |
init() | |
} |
This file contains 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
/* | |
* This is all Eric Nieblers work, see: https://youtu.be/h-ExnuD6jms | |
*/ | |
import Foundation | |
protocol Receiver<T> { | |
associatedtype T | |
func setValue(_ value: T) |
This file contains 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
/* | |
* 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 { |
This file contains 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 <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 file contains 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
/* | |
* 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) { |
This file contains 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
// | |
// BikeRRUITests.swift | |
// BikeRRUITests | |
// | |
// Created by Oliver Epper on 14.08.21. | |
// | |
// swiftlint:disable all | |
import XCTest |
This file contains 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 <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); |
This file contains 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
import Foundation | |
struct Output: TextOutputStream { | |
mutating func write(_ string: String) { | |
print(string, terminator: "") | |
} | |
} | |
protocol Drawable { | |
func draw_(out: inout Output, position: Int) |
NewerOlder