I hereby claim:
- I am ksqsf on github.
- I am ksqsf (https://keybase.io/ksqsf) on keybase.
- I have a public key ASDeVaqf2TVkWAwoSMtQcBtMNhw8mKc7r-APIwQe8wSV2Ao
To claim this, I am signing this object:
| # Copied from https://www.reddit.com/r/bashonubuntuonwindows/comments/11vx61n/comment/jdh2ovy/ | |
| # This problem only happens when you enable systemd support in /etc/wsl.conf. | |
| apt update && apt install binfmt-support -y | |
| cat > /usr/lib/binfmt.d/WSLInterop.conf <<EOF | |
| :WSLInterop:M::MZ::/init:PF | |
| EOF | |
| systemctl restart systemd-binfmt |
| // The 'rayon' crate is required for parallel computing. | |
| use rayon::prelude::*; | |
| use std::fmt; | |
| use std::io; | |
| use std::io::Write; | |
| use std::mem; | |
| use std::str; | |
| const N: usize = 6; |
| # Kitchen-sink for setting PATHs and other environmental variables. | |
| # Also read by Emacs's exec-path-from-shell, so it has to be very short and fast. | |
| export HOMEBREW_NO_INSTALL_FROM_API=1 | |
| export HOMEBREW_NO_AUTO_UPDATE=1 | |
| export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git" | |
| export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git" | |
| export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles" | |
| export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api" |
| import requests | |
| import json | |
| # Doc site: https://plugins-doc.logseq.com/ . | |
| # This list is auto-generated from https://github.com/logseq/plugins/tree/master/docs . | |
| apis = [ | |
| 'logseq.settings', | |
| 'logseq.updateSettings', | |
| 'logseq.once', | |
| 'logseq.toggleMainUI', |
| (ql:quickload :dexador) ;; HTTP | |
| (ql:quickload :yason) ;; JSON | |
| (defun download-bilibili-audio (audio-id) | |
| (let* ((headers '(("User-Agent" . "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18") | |
| ("Referer" . "https://bilibili.com"))) | |
| (cover-json (yason:parse (dex:get (format nil "https://www.bilibili.com/audio/music-service-c/web/song/info?sid=~a" audio-id)))) | |
| (cover-url (gethash "cover" (gethash "data" cover-json))) | |
| (cover-data (dex:get cover-url)) | |
| (audio-json (yason:parse (dex:get (format nil "https://www.bilibili.com/audio/music-service-c/web/url?sid=~a" audio-id)))) |
| #!/usr/bin/env cargo play -q | |
| //# anyhow = "*" | |
| //# reqwest = {version="*", features=["gzip","blocking"]} | |
| //# serde_json = "*" | |
| fn main() -> anyhow::Result<()> { | |
| let audio_id = "832257"; | |
| let client = reqwest::blocking::Client::new(); | |
| let body = client.get(format!("https://www.bilibili.com/audio/music-service-c/web/song/info?sid={}", audio_id)).send()?.text()?; | |
| let resp = &serde_json::from_str::<serde_json::Value>(&body)?["data"]["cover"]; | |
| let cover_url = resp.as_str().unwrap(); |
| #!/usr/bin/env cabal | |
| {- cabal: | |
| build-depends: base, relude, aeson, microlens-aeson, microlens-platform, http-conduit, conduit, conduit-extra, async | |
| -} | |
| {-# LANGUAGE OverloadedStrings #-} | |
| {-# LANGUAGE NoImplicitPrelude #-} | |
| module Main where | |
| import Control.Concurrent.Async |
| import requests | |
| # | |
| # *** 修改这个 *** | |
| # | |
| audio_id = '832257' | |
| # 完事后会下载到一个 m4a 文件和一个 cover.jpg | |
I hereby claim:
To claim this, I am signing this object:
| {- | |
| HOWTO: use 'tellWords' to find possible inputs, guess, and then update 'rules'. | |
| -} | |
| module Main where | |
| import System.IO | |
| import Control.Monad.ST | |
| import Data.Array.MArray | |
| import GHC.Arr |