Skip to content

Instantly share code, notes, and snippets.

View ushell's full-sized avatar
🎯
Focusing 🚣🏻‍♀️

ushell

🎯
Focusing 🚣🏻‍♀️
View GitHub Profile
<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>增强版页面截图分享功能</title>
<!-- 引入外部资源 -->
<script src="https://cdn.tailwindcss.com"></script>
<link
href="https://cdn.jsdelivr.net/npm/font-awesome@4.7.0/css/font-awesome.min.css"
@ushell
ushell / html_colorful_button.html
Created October 21, 2024 14:14
html_colorful_button.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport"
content="width=device-width,user-scalable=0, initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0">
<title>Document</title>
<style>
@ushell
ushell / gist:1be959f7fc4398eb62b58bd5346aea47
Created July 20, 2024 15:20
fetch_html_images_to_pdf.py
#!/usr/bin/env python3
import os
from bs4 import BeautifulSoup
from lxml import etree
import requests
import img2pdf
def jpg2pdf(fileList):
with open("images.pdf", "wb") as f:
@ushell
ushell / pbcopy.go
Created July 26, 2023 06:52
pbcopy remote ssh
// GOOS=linux GOARCH=amd64 go build -o pbcopy
package main
import (
"bufio"
"fmt"
"os"
"github.com/aymanbagabas/go-osc52/v2"
)
<?php
use Hyperf\Contract\ConfigInterface;
use Hyperf\LoadBalancer\LoadBalancerInterface;
use Hyperf\LoadBalancer\LoadBalancerManager;
use Hyperf\LoadBalancer\Node;
use Hyperf\ServiceGovernance\DriverInterface;
use Hyperf\ServiceGovernance\DriverManager;
use Hyperf\ServiceGovernanceConsul\ConsulDriver;
use Hyperf\Utils\ApplicationContext;
use Psr\Container\ContainerInterface;
@ushell
ushell / go_worker_example.go
Created October 12, 2022 07:19
go 并发处理示例
// You can edit this code!
// Click here and start typing.
package main
import (
"fmt"
"sync"
"time"
)
@ushell
ushell / file_dir.php
Created May 12, 2022 03:27
文件目录遍历
<?php
$dir = "/tmp";
$fd = \FilesystemIterator($dir);
foreach(iterator_to_array($fd) as $item) {
var_dump($item->getFilename());
}
@ushell
ushell / unzip-extract-utf8-file.sh
Created April 10, 2022 10:43
unzip extract utf8 files
# debian
# verison: 6.0
# `-a`
$unzip -a demo.zip
package main
import (
"embed"
"fmt"
"io/fs"
"log"
"net/http"
"os"
)
package main
import (
"bytes"
"crypto/aes"
"encoding/base64"
"errors"
)
type Aes struct{}