I hereby claim:
- I am jmg-duarte on github.
- I am jmgduarte (https://keybase.io/jmgduarte) on keybase.
- I have a public key ASCzSL2zUTqYGDlKA8Pe2l-tQn58IYUaOE6ni1WJZVUIhQo
To claim this, I am signing this object:
use std::{io::Cursor, str::FromStr}; | |
use cid::Cid; | |
use codec::{Decode, Encode, IoReader}; | |
use storagext::{ | |
runtime::runtime_types::pallet_market::pallet::DealProposal as RtDealProposal, | |
types::market::DealProposal, BlockNumber, Currency, | |
}; | |
use subxt::ext::sp_runtime::AccountId32; |
/// Sets up the global shortcuts (currently, just Cmd+Shift+ç) | |
/// | |
/// References: | |
/// https://developer.apple.com/forums/thread/707680?answerId=716892022#716892022 | |
/// https://developer.apple.com/documentation/coregraphics/cgevent/1454426-tapcreate | |
/// https://stackoverflow.com/a/55617464/28296770 | |
func setupGlobalShortcuts() -> CFMachPort? { | |
// TODO: store in UserSettings if it is the first time the user is opening the app | |
// if it is, use CGRequestListenEventAccess, otherwise, just check with Preflight | |
let keyDownEventMask = CGEventMask(1 << CGEventType.keyDown.rawValue) |
pin_project! { | |
pub struct BlockStream<R> { | |
#[pin] | |
reader: R, | |
buf: BytesMut, | |
} | |
} | |
impl<R: AsyncRead> Stream for BlockStream<R> { | |
type Item = io::Result<BytesMut>; |
import json | |
from typing import Any, Tuple | |
type RGB = Tuple[int, int, int] | |
type RGBA = Tuple[int, int, int, int] | |
def rgba_to_rgb(foreground: RGBA, background: RGB) -> RGB: | |
(fg_r, fg_g, fg_b, fg_a) = foreground | |
(bg_r, bg_g, bg_b) = background |
# Huge kudos to everyone working on yt-dlp, that's the heavylifting part | |
# | |
# The link points to Japanology+ but it should work with other series, | |
# maybe you'll need some adjustments to the jq query though | |
curl https://nwapi.nhk.jp/nhkworld/vodesdlist/v7b/program/japanologyplus/en/all/all.json | | |
jq -r ".data.episodes[].url" | | |
sed "s|^|https://www3.nhk.or.jp|" | | |
xargs -n 1 -P 2 yt-dlp |
-- vim-plug | |
local Plug = vim.fn['plug#'] | |
vim.call('plug#begin', '~/.config/nvim/plugged') | |
-- plenary provides utility functions for other plugins | |
-- think of it as a neovim plugin standard library | |
Plug('nvim-lua/plenary.nvim') | |
-- fuzzy finder file browser | |
Plug('nvim-telescope/telescope.nvim') |
// Credits: Yandros#4299 | |
macro_rules! parse_quote {( | |
$($code:tt)* | |
) => ({ | |
eprintln!("[{}:{}:{}] parse_quote! {{ {} }}", file!(), line!(), column!(), quote!( $($code)* )); | |
::syn::parse_quote!( $($code)* ) | |
})} | |
macro_rules! parse_quote {( |
I hereby claim:
To claim this, I am signing this object:
# add_newline = false | |
format="""\ | |
$directory\ | |
$package\ | |
$git_branch\ | |
$line_break\ | |
$hostname\ | |
$character\ | |
""" |
font_family Jetbrains Mono | |
bold_font Jetbrains Mono Bold | |
italic_font Jetbrains Mono Italic | |
bold_italic_font Jetbrains Mono Medium Italic | |
font_size 9.0 | |
window_padding_width 10 | |
initial_window_height 1280 |