type ScalarField = 'ID' | 'String'
type ResolvableField<Out extends ObjectType<any>> = {
type: Out
resolve: () => Out extends ObjectType<infer Src> ? Src : never
}
export class ObjectType<Src> {
constructor(public name: string) {}
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
# Pre installtion notice: | |
# - The iso image can be downloaed from: https://www.android-x86.org/download.html | |
# - Linux Zen is recommended. See: https://riq0h.jp/2020/12/07/210053/ | |
# - Also see: https://wiki.archlinux.org/title/QEMU | |
sudo pacman -S qemu-full | |
sudo pacman -S qemu-desktop | |
qemu-img create -f raw android 16G |
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
use anyhow::Result; | |
use eventsource_client::{Client, ReconnectOptions, SSE}; | |
use futures::TryStreamExt; | |
use std::time::Duration; | |
const URL: &str = "http://localhost:8000/sse"; | |
#[tokio::main] | |
async fn main() -> Result<()> { | |
let client = eventsource_client::ClientBuilder::for_url(URL)? |
Newer bluez is buggy. It makes CPU usage 100% randomly.
5.72
is working fine. Let's keep using it.
sudo pacman -U /var/cache/pacman/pkg/bluez*5.72-2-x86_64.pkg.tar.zst
I need to ignore upgrading bluez until a stable version is released. To do so,
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
function handler(event) { | |
var request = event.request | |
var uri = request.uri | |
// Check whether the URI is missing a file name. | |
if (uri.endsWith('/')) { | |
return { | |
statusCode: 301, | |
statusDescription: 'Moved Permanently', | |
headers: { |
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
.caClientJournalBookSpreadsheetAppRoot { | |
max-height: unset !important; | |
} |
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
build/plugins: ./packages/plugins/* | |
fnm use v16 | |
for dir in $^ ; do \ | |
bash -c "cd $${dir} && yarn && yarn build" ; \ | |
done |
Here is the best setup (I think so :D) for K-series Keychron keyboards on Linux.
Most of these commands have been tested on Ubuntu 20.04 and should also work on most Debian-based distributions. If a command happens not to work for you, take a look in the comment section.
Keychron Keyboards on Linux use the hid_apple
driver (even in Windows/Android mode), both in Bluetooth and Wired modes.
By default, this driver uses the F-keys as multimedia shortcuts and you have to press Fn
+ the key to get the usual F1 through F12 keys.
- Confirmed works on Cloudflare pages.
- Depends on Ruby and wget and imagemagick
- This script uses JPG with
quality 85
andinterlace -plane
(progressive JPEG) - Further improvement like WebP may be required
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 { Exchange } from 'urql'; | |
import { pipe, tap } from 'wonka'; | |
import { toast } from 'react-hot-toast'; | |
export const errorExchange: Exchange = | |
({ forward }) => | |
(ops$) => | |
pipe( | |
forward(ops$), | |
tap(({ error }) => { |
NewerOlder