Skip to content

Instantly share code, notes, and snippets.

View ioquatix's full-sized avatar
⚖️
Let's make it scalable!

Samuel Williams ioquatix

⚖️
Let's make it scalable!
View GitHub Profile
@ioquatix
ioquatix / make check
Created September 8, 2019 05:33
scotch 6.0.8 makepkg output
../../bin/atst ../../tgt/t4x4x4.tgt
A Terminals nbr=64
A Distance min=-1 max=6 avg=3.04762 dlt=1.83825
../../bin/gbase 1 data/m4x4.grf /tmp/m4x4_b1.grf
diff -q "data/m4x4_b1.grf" "/tmp/m4x4_b1.grf"
../../bin/gbase 1 data/m4x4_b1.grf /tmp/m4x4_b1.grf
diff -q "data/m4x4_b1.grf" "/tmp/m4x4_b1.grf"
../../bin/gbase 0 data/m4x4_b1.grf /tmp/m4x4.grf
diff -q "data/m4x4.grf" "/tmp/m4x4.grf"
../../bin/gmap data/bump.grf ../../tgt/h3.tgt /tmp/bump_h3.map -vmt
#!/usr/bin/env ruby
require 'csv'
require 'logger'
logger = Logger.new($stdout)
CSV do |csv|
5.times do
logger.info "Generating row..."
@ioquatix
ioquatix / O(N) memory allocations.txt
Created April 27, 2019 22:22
10k WebSockets with Falcon
[
[WebSocket::Driver::OpenEvent, 10000],
[WebSocket::Extensions, 10001],
[WebSocket::Driver::Headers, 10001],
[WebSocket::Driver::StreamReader, 10001],
[WebSocket::Driver::Hybi, 10001],
[Async::WebSocket::Server, 10001],
[Addrinfo, 10001],
[Async::HTTP::Protocol::HTTP1::Server, 10001],
[HTTP::Protocol::Headers, 10001],
#
# This file is part of the "Teapot" project, and is released under the MIT license.
#
teapot_version "2.3"
# Project Metadata
define_project "time" do |project|
@ioquatix
ioquatix / async-slack.rb
Last active April 16, 2022 22:28
Make slack-api great again
# This is used in production, but I've extracted everything here, so this particular code is untested, but should work.
gem 'async-http-faraday'
gem 'async-websocket'
gem 'slack-api'
require 'slack'
require 'async/http/url_endpoint'
@ioquatix
ioquatix / atom.css
Created March 15, 2018 09:57
Switch off ligatures on current lines, in quoted strings, and in regular expressions
* {
-webkit-font-smoothing: antialiased;
}
atom-text-editor {
text-rendering: optimizeLegibility;
}
atom-text-editor.editor .syntax--comment {
font-style: normal !important;
0493b1a5afb2044a2bf3b1eb3d7268cbba9027a2d550660e78bbf04e361a26babbd906bf6c91044097d73b2e4927e1d1c532bdf11e6e17bf8866935351de3f9287
#!/usr/bin/env ruby
require 'async/io'
require 'async/http/server'
require 'async/dns'
def print_server
Async::Reactor.run do |task|
task.async do
http_endpoints = Async::IO::Endpoint.tcp('localhost', 8081, reuse_port: true)
#!/usr/bin/env ruby
require 'async'
require 'lightio'
def run_async(count = 10000)
start = Time.now
Async::Reactor.run do |task|
tasks = count.times.map do
@ioquatix
ioquatix / aio.rb
Last active March 28, 2017 02:16
rough outline of fiber based concurrency
#!/usr/bin/env ruby
require 'fiber'
require 'nio'
module Async
end
class Async::Await
def initialize(ios, reactor)