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
// Server-Sent Events (SSE) with tokio broadcast channel - with cors | |
// Note: seems to be cors error still while connecting. | |
use async_stream::stream; | |
use axum:: { | |
extract::State, response::{sse::{Event, KeepAlive, Sse}, IntoResponse}, routing::get, Json, Router | |
}; | |
use std::{ | |
convert::Infallible, sync::Arc, time::Duration | |
}; |
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
// Server-Sent Events (SSE) with tokio broadcast channel | |
// Update: removed arc/mutex. | |
use async_stream::stream; | |
use axum:: { | |
extract::State, response::{sse::{Event, KeepAlive, Sse}, IntoResponse}, routing::get, Json, Router | |
}; | |
use std::{ | |
convert::Infallible, sync::Arc, time::Duration | |
}; |
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
open Donald | |
open System.Data.Common | |
open System.Data.SQLite | |
open System.Threading.Tasks | |
open Giraffe | |
open Giraffe.ViewEngine | |
open FsToolkit.ErrorHandling | |
open Microsoft.AspNetCore.Builder | |
[<RequireQualifiedAccess>] |
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
Updated list / Nov 17 - 2024 | |
Posting - https://posting.sh/ - Terminal Based | |
ATAC - https://github.com/Julien-cpsn/ATAC | |
Rest.nvim - https://github.com/rest-nvim/rest.nvim | |
Slumber - (uses tui client) https://slumber.lucaspickering.me/ |
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
fn main() { | |
let json_str = std::fs::read_to_string("../posts.json").unwrap(); | |
let posts: Vec<Post> = from_str(&json_str).unwrap(); | |
let start = Instant::now(); | |
let mut post_tags_map: FxHashMap<&str, Vec<u16>> = FxHashMap::default(); | |
for (post_idx, post) in posts.iter().enumerate() { | |
for tag in post.tags.iter() { |
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 http from 'https'; | |
import sharp from 'sharp'; | |
import fs from 'fs'; | |
const | |
remoteImageUrl = 'https://s2.coinmarketcap.com/static/img/coins/64x64/1.png', | |
outputPath = 'resized.jpg', | |
urlParts = new URL(remoteImageUrl), | |
options = { | |
hostname: urlParts.hostname, |
NewerOlder