// main.rs
use std::time::Instant;
fn main() {
let instant = Instant::now();
let text = "".to_string();
for _ in 1..100000000 {
let _ = text.to_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
prql | |
.query() | |
.from('invoices') | |
.derive({ | |
transaction_fee: 0.8, | |
income: 'total - transaction_fee', | |
}) | |
.filter('income', '>', 5) | |
.filter('invoice_date', '>=', '@2010-01-16') | |
.group('customer_id', { |
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 { DateTime } from 'luxon' | |
const a = DateTime.now().setZone('Asia/Tokyo') | |
const b = DateTime.fromISO('2024-11-07').setZone('Asia/Tokyo').endOf('day') | |
const c = DateTime.now() | |
console.log({ a, b, c }) | |
console.log(a < b) | |
console.log(b < c) |
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 fs from 'fs' | |
const header = ` | |
# | |
# This file is auto generated. Do not edit by hand. | |
# | |
`.trimStart() | |
const schema = fs.readFileSync('path/to/schema.graphql', 'utf8') | |
const allMutations = generateAllMutations(schema).join('\n') |
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 |
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
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; | |
} |
NewerOlder