Другие интересные штуки тут: https://t.me/notes_of_programmer
select pid, user, client_addr, query_start, backend_type, substr(query, 0, 256) as query
from pg_stat_activity
where query_start is not null
and client_addr is not null;
Другие интересные штуки тут: https://t.me/notes_of_programmer
select pid, user, client_addr, query_start, backend_type, substr(query, 0, 256) as query
from pg_stat_activity
where query_start is not null
and client_addr is not null;
This document now exists on the official ASP.NET core docs page.
Node Version Manager (https://github.com/nvm-sh/nvm) works perfectly across native node installations as well as emulated Rosetta installations. The trick I am using here is to install one LTS version of node under Rosetta and another stable version as native binary.
import 'package:flutter/material.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
home: Scaffold( | |
body: Center( |
import io.realm.* | |
import io.realm.kotlin.where | |
import kotlinx.coroutines.GlobalScope | |
import kotlinx.coroutines.launch | |
import kotlinx.coroutines.suspendCancellableCoroutine | |
import kotlin.coroutines.resume | |
import kotlin.coroutines.resumeWithException | |
private suspend fun <T: RealmObject, S: RealmQuery<T>> findAllAwait(query: S): RealmResults<T> = suspendCancellableCoroutine { continuation -> | |
val listener = RealmChangeListener<RealmResults<T>> { t -> continuation.resume(t) } |
import java.io.ByteArrayOutputStream | |
import java.io.File | |
import java.nio.charset.StandardCharsets.UTF_8 | |
import java.util.zip.GZIPInputStream | |
import java.util.zip.GZIPOutputStream | |
fun gzip(content: String): ByteArray { | |
val bos = ByteArrayOutputStream() | |
GZIPOutputStream(bos).bufferedWriter(UTF_8).use { it.write(content) } | |
return bos.toByteArray() |
#!/usr/bin/env ruby | |
require 'yaml' | |
TYPE_TO_KSY = { | |
'uint8_t' => 'u1', | |
'uint16_t' => 'u2', | |
'uint32_t' => 'u4', | |
'uint64_t' => 'u8', |