Skip to content

Instantly share code, notes, and snippets.

View amphineko's full-sized avatar
🍊
Have a job but do open-source when not busy

amphineko amphineko

🍊
Have a job but do open-source when not busy
  • 14:32 (UTC)
View GitHub Profile
[amphineko@lab-asta]~/amcode/BangumiMCP% uv run ./test_query.py
Connecting to http://127.0.0.1:8000/sse...
Received session endpoint: /messages/?session_id=3b4299ba580d431780ca2cda194861e8
Sending initialize request...
Received initialize response. Sending initialized notification...
Sending tools/list request...
Total tools found: 55
Searching for '羊宫妃那'...

proxmox-backup-client.{service,timer}

Usage

Populates files to the backup client host:

/etc/systemd/system/proxmox-backup-client@.service
/etc/systemd/system/proxmox-backup-client@.timer
/etc/systemd/system/proxmox-backup-client.env
.editor-group-watermark > .letterpress{
background-image: url("https://raw.githubusercontent.com/Aikoyori/ProgrammingVTuberLogos/main/VSCode/VSCode.png") !important;
opacity: .75;
}
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using UnityEngine.Bindings;
using UnityEngine.Internal;
using UnityEngine.SceneManagement;
@amphineko
amphineko / khala-block-scan.js
Last active August 20, 2021 15:55
Khala: something is wrong at #58602
const start = 58600
const end = 58700
for (let i = start; i < end; i++) {
if (i % 100 === 0) {
console.log(`fetch block [${i}, ${i + 99}]`)
}
const blockHash = await api.rpc.chain.getBlockHash(i)
try {
print('Knot Resolver ' .. package_version())
modules = {
'bogus_log',
'hints',
'predict',
'prefill',
'workarounds < iterate',
}
@amphineko
amphineko / io-ts-playground.ts
Created July 10, 2020 19:58
io-ts decoding and custom types example
import { either, isLeft, isRight } from 'fp-ts/lib/Either'
import * as it from 'io-ts'
import { Int, Type, TypeOf } from 'io-ts'
import { PathReporter } from 'io-ts/lib/PathReporter'
// custom type: integer string
const IntegerString = new Type<number, string, unknown>(
'IntegerString',
Int.is,
#include <condition_variable>
#include <cstdio>
#include <mutex>
#include <queue>
#include <thread>
extern "C"
{
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
@amphineko
amphineko / CreateLinkedTokenSource.cs
Last active November 26, 2019 22:41
CancellationTokenSource.CreateLinkedTokenSource won't cancel peer tokens.
using System.Diagnostics;
var timeout = new CancellationTokenSource(TimeSpan.FromSeconds(1));
var observer = new CancellationTokenSource();
var linked = CancellationTokenSource.CreateLinkedTokenSource(timeout.Token, observer.Token);
await Task.Run(async () => {
try
{
@amphineko
amphineko / webpack.config.js
Created September 22, 2019 23:12
cursed webpack
const path = require('path')
const { CleanWebpackPlugin: CleanPlugin } = require('clean-webpack-plugin')
const HtmlPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
module.exports = (env, argv) => {
const isProduction = argv.mode === 'production'
return {