Skip to content

Instantly share code, notes, and snippets.

View aimerneige's full-sized avatar
🎯
Keep Coding

Aimer Neige aimerneige

🎯
Keep Coding
View GitHub Profile
@aimerneige
aimerneige / baidu-ocr-with-gui.py
Created March 25, 2023 11:42
PyQt OCR Software With Baidu API
#!/usr/env/bin python3
# -*- coding: utf-8 -*-
import sys
import base64
import requests
from enum import Enum
from PyQt5 import QtCore
from PyQt5.QtGui import QPixmap
from PyQt5.QtCore import QSize, pyqtSlot
@aimerneige
aimerneige / ai.go
Created March 16, 2023 08:56
国产 AI 吊打 ChatGPT
package ai
func Ai(q string) string {
if q == "你好" {
return "你好"
} else {
return "对不起,您输入的内容中包含敏感内容,根据相关法律法规,无法给出答复。"
}
}
@aimerneige
aimerneige / friends.html
Created March 12, 2023 06:22
friend link shortcode for hugo site
<style type="text/css">
.friends {
--link-count-per-row: 1;
}
@media screen and (min-width: 576px) {
.friends {
--link-count-per-row: 2;
}
}
@aimerneige
aimerneige / fonts.conf
Last active December 12, 2024 17:10 — forked from rydesun/fonts.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
<!-- Default system-ui fonts -->
<match target="pattern">
<test name="family">
<string>system-ui</string>
</test>
<edit name="family" mode="prepend" binding="strong">
@aimerneige
aimerneige / download_tarot_images.py
Created February 10, 2023 16:18
Download all tarot images from Wikipedia
# -*- coding: utf-8 -*-
# Author: AimerNeige
import os
import requests
from bs4 import BeautifulSoup
out_dir = "./tarot"
url = 'https://en.m.wikipedia.org/wiki/Rider%E2%80%93Waite_Tarot'
html = requests.get(url).text
if (Get-ScheduledTask -TaskName "RamDisk" -ErrorAction SilentlyContinue) {
Write-Host "Ramdisk Task schduler already configured." -ForegroundColor Green
} else {
Write-Host "Configuring task scheduler to start Ramdisk in the background..." -ForegroundColor Green
Set-Content -Path "$env:APPDATA\ramdisk.cmd" -Value "`"C:\Program Files\OSFMount\osfmount.com`" -a -t vm -o format:ntfs:`"RAM Volume`" -o physical -o gpt -s 4G"
$taskAction = New-ScheduledTaskAction -Execute "$env:APPDATA\ramdisk.cmd"
$trigger = New-ScheduledTaskTrigger -AtLogOn
$principal = New-ScheduledTaskPrincipal -RunLevel Highest -UserId (Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -expand UserName)
$settings = New-ScheduledTaskSettingsSet –AllowStartIfOnBatteries –DontStopIfGoingOnBatteries -Hidden -ExecutionTimeLimit (New-TimeSpan -Minutes 5) -RestartCount 3
Register-ScheduledTask -Action $taskAction -Trigger $trigger -TaskName "RamDisk" -Description "Start ramdisk in the background." -Setti
@aimerneige
aimerneige / install-icalingua-plus-plus_rpm_x86_64.sh
Last active August 9, 2022 05:12
Install Icalingua-Plus-Plus
set -e
icalingua_latest_download_link=$(curl -s https://api.github.com/repos/Icalingua-plus-plus/Icalingua-plus-plus/releases/latest | grep browser_download_url | grep x86_64.rpm | cut -d '"' -f 4)
mkdir -p /tmp/Icalingua
wget ${icalingua_latest_download_link} -O /tmp/Icalingua/Icalingua.rpm
sudo dnf install /tmp/Icalingua/Icalingua.rpm
rm /tmp/Icalingua -rf
@aimerneige
aimerneige / ddlcpad.rs
Last active July 14, 2022 02:28
ddlcpad in rust
use std::fs::File;
use std::io::prelude::*;
fn main() {
let mut f = File::open("foo.cy").unwrap();
let mut buffer = Vec::new();
// read the whole file
f.read_to_end(&mut buffer).unwrap();

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@aimerneige
aimerneige / image-flip.go
Created June 6, 2022 14:29
flip a image using go
package main
import (
"image"
"log"
"os"
"github.com/disintegration/imaging"
)