Skip to content

Instantly share code, notes, and snippets.

View ttionya's full-sized avatar

ttionya ttionya

View GitHub Profile
@ttionya
ttionya / setup.js
Created September 5, 2023 16:04
Melvor Idle Township v1.1.2
const objs = game.items.registeredObjects
function setDropTable(dropTable, dropData) {
dropTable.totalWeight = dropData.reduce((p, c) => p + c.weight, 0)
dropTable.drops.length = 0
dropData.forEach((data) => {
const item = objs.get(data.key)
if (!item) throw Error(`Not found ${data.key}`)
@ttionya
ttionya / index.css
Created August 4, 2020 08:38
颜色渐变 CSS 变量
/*
* chinese-gradient
*
* CDN: https://unpkg.zhimg.com/chinese-gradient
* Document: https://www.yuque.com/fancy-components/xflqsh/yxn4m7
*/
:root {
--胭脂红:linear-gradient(#ff9569, #e92758);
--宝石蓝:linear-gradient(#29bdd9, #276ace);
--天蓝:linear-gradient(#2980b9, #6dd5fa, white);
FROM alpine
ARG version
ARG confuse=2ra
RUN apk update \
&& apk add --no-cache ca-certificates wget unzip \
&& mkdir -p /app/ \
&& cd /app/ \
&& wget https://github.com/v${confuse}y/v${confuse}y-core/releases/download/${version}/v${confuse}y-linux-64.zip \
@ttionya
ttionya / watermark.html
Created October 27, 2019 12:25
证件照⽔印
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover">
<title>证件照⽔印</title>
<style>
html,
body {
@ttionya
ttionya / archive.sh
Created April 18, 2018 15:22
打包 Git 两个版本变更的文件
#!/bin/bash
git archive -o patch.tar HEAD $(git diff --name-only --diff-filter=ACMRT HEAD^)
# git diff --name-only --diff-filter=ACMRT HEAD^ | xargs tar -rf patch.tar
@ttionya
ttionya / duoshuo-migrate-to-disqus.php
Created May 21, 2017 15:58
将多说评论导入 Disqus
<?php
/*
* 感谢 http://urouge.github.io/migrate-to-disqus/,此脚本来自他的博客
*
* 使用说明:
* 1. 在多说后台下载评论文件,默认文件名是 export.json
* 2. 下载文件 migrate.php,位置与 export.json 同级
* 3. 打开终端,进入文件 migrate.php 所在目录,执行 php -f migrate.php 即可在同级目录生成 disqus.xml 文件
* 4. 在 Disqus 后台选择 Generic(WXR)导入即可,地址是 https://{你的站点名}.disqus.com/admin/discussions/import/platform/wordpress/
* 5. 队列可以在 https://import.disqus.com/ 查看导入状态