Skip to content

Instantly share code, notes, and snippets.

🤦‍♂
Permanent 418 status code.

Jon Gjengset jonhoo

🤦‍♂
Permanent 418 status code.
Block or report user

Report or block jonhoo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View podcast.xml
<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
>
<channel>
<atom:link href="{{ site.url }}{{ page.url }}" rel="self" type="application/rss+xml" />
<link>{{ site.url }}</link>
View googleplay-podcast-sample-feed.xml
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:googleplay="http://www.google.com/schemas/play-podcasts/1.0" version="2.0">
<channel>
<title>The Unknown Podcast</title>
<link>http://sample.com/podcasts/unknown/index.html</link>
<language>en-us</language>
<copyright>℗ 2025 Unknown Podcaster Corp</copyright>
<googleplay:author>Unannounced Podcaster</googleplay:author>
<googleplay:description>The Unknown Podcast will look at all the things that are unknown or unknowable. Find us on Google Play Music!</googleplay:description>
<description>The Unknown Podcast will look at all the things that are unknown or unknowable.</description>
View trace-timing-through-buffer
view-request::submit request:
mean: 5.3µs, p50: 8µs, p90: 16µs, p99: 24µs, p999: 24µs, max: 24µs, #: 34
1µs | ************************************ | 88.2th %-ile
2µs | | 88.2th %-ile
4µs | | 88.2th %-ile
8µs | | 88.2th %-ile
16µs | **** | 97.1th %-ile
view-request::waiting for service readiness:
mean: 1404.2µs, p50: 1466µs, p90: 1859µs, p99: 3670µs, p999: 3670µs, max: 3670µs, #: 34
64µs | ** | 2.9th %-ile
View tower-buffer-trace.diff
diff --git a/tower-buffer/Cargo.toml b/tower-buffer/Cargo.toml
index 328a0c7..4728c9e 100644
--- a/tower-buffer/Cargo.toml
+++ b/tower-buffer/Cargo.toml
@@ -21,12 +21,17 @@ Buffer requests before dispatching to a `Service`.
categories = ["asynchronous", "network-programming"]
edition = "2018"
+[features]
+log = ["tracing/log"]
View compile-errors
| cargo t
Compiling hdrhistogram v6.1.1
Compiling crossbeam-deque v0.7.1
Compiling rand v0.6.5
Compiling parking_lot v0.6.4
Compiling hdrsample v6.0.3
Compiling tower-spawn-ready v0.1.0 (/home/jon/dev/others/tower/tower-spawn-ready)
Compiling tower-limit v0.1.0
Compiling tower-load v0.1.0 (/home/jon/dev/others/tower/tower-load)
error[E0277]: the trait bound `tokio_sync::oneshot::error::RecvError: std::error::Error` is not satisfied
@jonhoo
jonhoo / tokio-timer-fd.rs
Created Apr 19, 2019
A timerfd based implementation of a timer future for tokio
View tokio-timer-fd.rs
struct OneShotTimer {
fd: Box<std::os::unix::io::RawFd>,
e: Option<tokio_reactor::PollEvented<mio::unix::EventedFd<'static>>>,
}
impl OneShotTimer {
fn new(d: time::Duration) -> io::Result<Self> {
if d.as_secs() == 0 && d.subsec_nanos() == 0 {
// this would be interpreted as "inactive timer" by timerfd_settime
return Ok(OneShotTimer {
View hyper-tower-buffer.rs
#!/usr/bin/env run-cargo-script
//! ```cargo
//! [dependencies]
//! tokio = "0.1"
//! hyper = "0.12"
//! futures = "0.1"
//! tower-service = { git = "https://github.com/tower-rs/tower.git" }
//! tower-buffer = { git = "https://github.com/tower-rs/tower.git" }
//! ```
extern crate futures;
View at-a-time-service.rs
extern crate async_bincode;
#[macro_use]
extern crate futures;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate bincode;
extern crate tokio;
extern crate tower_service;
@jonhoo
jonhoo / discord-legibility.css
Last active Jul 6, 2018
Stylesheet for making Discord Light at least somewhat easier to read
View discord-legibility.css
.message-group .comment .markup, .chat {
color: inherit;
}
.message-group.compact .message .timestamp {
color: #555;
float: right;
}
.reaction .reaction-count {
color: inherit;
You can’t perform that action at this time.