Skip to content

Instantly share code, notes, and snippets.

View SLAPaper's full-sized avatar
🤣
lmao

SLAPaper Pang SLAPaper

🤣
lmao
View GitHub Profile
@SLAPaper
SLAPaper / fix_lobe.js
Last active September 3, 2023 08:09
FIx Lobe Theme in A1111 WebUI v1.6.0RC
// ==UserScript==
// @name A1111 WebUI fix lobe theme
// @namespace http://tampermonkey.net/
// @version 0.3
// @description fix Lobe theme broken webui v1.6.0
// @author SLAPaper, primeinc
// @match http*://localhost:7860/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=undefined.localhost
// @grant none
// ==/UserScript==
@SLAPaper
SLAPaper / Basic API call (TypeScript).EXCEL.yaml
Created May 12, 2022 18:25
Performs a basic Excel API call using TypeScript.
name: Basic API call (TypeScript)
description: Performs a basic Excel API call using TypeScript.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@SLAPaper
SLAPaper / chinese-gb7714-2005-numeric-auto-lang.csl
Last active June 7, 2019 16:45
Chinese GB/T 7714-2005 CSL-M that correctly deal with English citation with more than 3 authors.
<?xml version="1.0" encoding="utf-8"?>
<style xmlns="http://purl.org/net/xbiblio/csl" class="in-text" version="1.0" demote-non-dropping-particle="sort-only" default-locale="zh-CN">
<info>
<title>Chinese Std GB/T 7714-2005 (numeric, auto languange)</title>
<id>chinese-gb7714-2005-autolang</id>
<link href="https://gist.github.com/SLAPaper/19497b1cf37bc7c8bb4af9969fe69e9a" rel="self"/>
<link href="http://gradschool.ustc.edu.cn/ylb/material/xw/wdxz/19.pdf" rel="documentation"/>
<author>
<name>SLAPaper</name>
<email>slapaper@pku.edu.cn</email>
@SLAPaper
SLAPaper / throttle.py
Last active April 9, 2019 18:22 — forked from ChrisTM/throttle.py
Python decorator for throttling function calls.
# https://gist.github.com/SLAPaper/9ef3699e5f76dc80c00bd2d405eef995
from datetime import datetime, timedelta
from functools import wraps
class throttle:
"""
Decorator that prevents a function from being called more than once every
time period.
@SLAPaper
SLAPaper / Update-pip.ps1
Created February 4, 2019 05:18
Pip-Upgrade-All for (Powershell, cmd, bash)
Param(
[Parameter(Position = 0)]
[string[]]$python_name = ('python'),
[string[]]$Exclude = (''),
[bool]$NoDeps = $false
)
foreach ($python in $python_name) {
@SLAPaper
SLAPaper / save_to_zotero.js
Created November 2, 2018 03:02
Save to Zotero
// ==UserScript==
// @name Save to Zotero
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Make Zotero's boorkmarklet a user script (click the button 'Zotero!' on bottom right)
// @author SLAPaper
// @match *://*/*
// @grant none
// ==/UserScript==
@SLAPaper
SLAPaper / JuejinMaxWidthSetter.js
Created June 19, 2018 10:08
Juejin Max-Width Setter.js
// ==UserScript==
// @name Juejin max-width setter
// @namespace http://tampermonkey.net/
// @version 0.1
// @description make the sidebar no longer overlaps the article
// @author You
// @match https://juejin.im/post/*
// @grant none
// @license MIT
// ==/UserScript==
@SLAPaper
SLAPaper / reuters_mlp_comparison (relu, elu, selu, swish).py
Last active October 26, 2021 19:41
Compare RELU, ELU, SELU, Swish and Scaled Swish in Reuters MLP (based on Keras' example)
'''Compares self-normalizing MLPs with regular MLPs.
Compares the performance of a simple MLP using two
different activation functions: RELU and SELU
on the Reuters newswire topic classification task.
# Reference:
Klambauer, G., Unterthiner, T., Mayr, A., & Hochreiter, S. (2017).
Self-Normalizing Neural Networks. arXiv preprint arXiv:1706.02515.
https://arxiv.org/abs/1706.02515
@SLAPaper
SLAPaper / SteamCartSorter.js
Last active June 26, 2020 14:53
sort steam cart items by price
// ==UserScript==
// @name Steam cart sorter
// @name:ZH-CN Steam 购物车自动排序
// @namespace http://tampermonkey.net/
// @version 0.8
// @description sort the Steam cart by price
// @description:ZH-CN 对 Steam 购物车中的物品按照价格排序
// @author SLAPaper
// @match http://store.steampowered.com/cart/*
// @match https://store.steampowered.com/cart/*
@SLAPaper
SLAPaper / BundleStar.js
Created April 1, 2017 15:28
Bundle Star auto get key
// ==UserScript==
// @name BundleStar_GetKey&Gift
// @Namespace http://tampermonkey.net/
// @version 1.03
// @description shows how to use babel compiler
// @icon https://cdn.bundlestars.com/production/brand/logo.png
// @author KamiXuan
// @match https://www.bundlestars.com/en/orders*
// ==/UserScript==