Skip to content

Instantly share code, notes, and snippets.

View claudiug's full-sized avatar
💜
I eat stickers all the time, dude.

Klaus Heissler claudiug

💜
I eat stickers all the time, dude.
  • cto@relatico / tng.sh
  • Austin / Chicago / Berlin
View GitHub Profile
import os
import sys
import boto3
from PySide2.QtCore import QRunnable, QObject, QThreadPool, Signal, Slot
from PySide2.QtWidgets import QMainWindow, QVBoxLayout, QProgressBar, QPushButton, QWidget, QApplication
class TestWindow(QMainWindow):
require 'webrick'
# How much of this is solved by frozen string literal?
Ractor.make_shareable(WEBrick::Config::HTTP)
Ractor.make_shareable(WEBrick::LF)
Ractor.make_shareable(WEBrick::CRLF)
Ractor.make_shareable(WEBrick::HTTPRequest::BODY_CONTAINABLE_METHODS)
Ractor.make_shareable(WEBrick::HTTPStatus::StatusMessage)
# To pick up changes from https://github.com/ruby/ruby/pull/4007
Object.send(:remove_const, :URI)
@noteflakes
noteflakes / chat.rb
Last active November 18, 2021 22:15
Real-world Concurrency with Ruby and Polyphony: a Telnet-based Chat App
# See also: https://noteflakes.com/articles/2021-11-13-real-world-polyphony-chat
require 'polyphony'
server = spin do
server_socket = TCPServer.new('0.0.0.0', 1234)
server_socket.accept_loop do |s|
spin { handle_session(s) }
end
end