Skip to content

Instantly share code, notes, and snippets.

use std::{
pin::Pin,
task::{Context, Poll},
};
use axum::{
body::{to_bytes, Body, Bytes},
extract::Request,
response::{IntoResponse, Response},
BoxError,
@jondot
jondot / jonhoo-trivia.md
Created June 17, 2022 15:18
jonhoo-trivia.md

TcpStream

Did you know that in its default configuration, TcpStream uses Nagle's Algorithm to schedule packet sends (https://en.wikipedia.org/wiki/Nagle%27s_algorithm), which can introduce unfortunate latency spikes. If you're particularly latency sensitive, consider calling TcpStream::set_nodelay(true)

std::fmt::Debug

Did you know that the Formatter argument to Debug::fmt makes it really easy to customize debug representations for structs, enums, lists, and sets? See the debug_* methods on it and

Formatter

https://www.apollographql.com/docs/apollo-server/migration-one-dot.html
https://dev-blog.apollodata.com/apollo-clients-new-imperative-store-api-6cb69318a1e3
https://dev-blog.apollodata.com/reusable-graphql-schema-directives-131fb3a177d1
https://dev-blog.apollodata.com/query-components-with-apollo-ec603188c157
http://engineering.khanacademy.org/posts/creating-query-components-with-apollo.htm
https://github.com/chantastic/reactpatterns.com
https://dev-blog.apollodata.com/the-future-of-state-management-dd410864cae2
https://dev-blog.apollodata.com/the-next-step-for-realtime-data-in-graphql-b564b72eb07b
https://dev-blog.apollodata.com/understanding-pagination-rest-graphql-and-relay-b10f835549e7
https://dev-blog.apollodata.com/improved-apollo-client-devtools-eb43258f103f
#!/bin/sh
eval `go build -work -a 2>&1` && find $WORK -type f -name "*.a" | xargs -I{} du -hxs "{}" | gsort -rh | sed -e s:${WORK}/::g
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
body {
background: #333;
}
* {
@jondot
jondot / index.html
Last active April 4, 2016 16:19 — forked from enjalot/index.html
d3.js sin waves
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<style type="text/css">
body {
background: #333;
}
{
"foo":1,
"bar":2
}
; filament used = 1309.2mm (3.1cm3)
; avoid_crossing_perimeters = 0
; bed_shape = 0x0,200x0,200x200,0x200
; bed_temperature = 70
; before_layer_gcode =
; bridge_acceleration = 0
; bridge_fan_speed = 100
; brim_width = 0
; complete_objects = 0
// MapView.js
var React = require('react-native');
var { View, Text, TouchableOpacity, requireNativeComponent } = React;
var RCTMapperManager = require('NativeModules').MapperManager;
class MapView extends React.Component {
foobar(){
RCTMapperManager.logstuff(
React.findNodeHandle(this),