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) |
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 <vector> | |
using namespace std; | |
template<typename T> void draw(const T& x, ostream& out, size_t position); | |
class object_t { | |
public: | |
template<typename T> object_t(T x) : self_(make_unique<model<T>>(move(x))) {} |
NewerOlder