Skip to content

Instantly share code, notes, and snippets.

View SukkaW's full-sized avatar
👓
Learning everything...

Sukka SukkaW

👓
Learning everything...
View GitHub Profile
if (!window.$) {
var script = document.createElement('script');
script.src = "https://cdn.bootcss.com/jquery/1.12.1/jquery.min.js";
document.body.appendChild(script);
}
//配置信息开始,使用按需修改
//播放公网视频(非校园网设置),如需要播放校园网视频将true改成false
var use_external_network = true;
//视频是否静音
@SukkaW
SukkaW / cfdc.json
Last active March 28, 2022 05:20
JSON format data of Cloudflare Data Centers
{
"AMS": {
"name": "Amsterdam, Netherlands",
"cnName": "荷兰阿姆斯特丹"
},
"ATH": {
"name": "Athens, Greece",
"cnName": "希腊雅典"
},
"BCN": {
var isSupportWebp = !![].map && document.createElement('canvas').toDataURL('image/webp').indexOf('data:image/webp') == 0;
var WebpName = "!/format/webp";
if (isSupportWebp) {
for (var i = 0; i < document.querySelectorAll("div[data-bg]").length; i += 1) {
var originSrc = document.querySelectorAll("div[data-bg]")[i].getAttribute('data-bg'),
newSrc = originSrc.replace(/((.png)|(.jpg)|(.jpeg))/g, '$1' + WebpName);
document.querySelectorAll("div[data-bg]")[i].setAttribute('data-bg', newSrc)
}
@SukkaW
SukkaW / speedtests.ml.md
Last active December 17, 2018 11:46
Introduction of speedtests.ml Service

speedtests.ml

Speedtests files download.

mirrors.speedtests.ml

Linux Mirror originated from LeaseWeb & Hosted by Cloudflare.

launchpad.speedtests.ml

#!/usr/bin/env php
<?php
// FIXME: Make this a proper app with unit-tests
require_once 'simple_html_dom.php';
exit(main($argv));
/**
* Scan a series of files for suspicious code
*
* example: find templates -name '*.tpl' | xargs php tools/scripts/tpl-lint
*
@SukkaW
SukkaW / return-prev.js
Created November 9, 2018 17:59
Return to previous page.
/*!
* return-prev.js
* Author: SukkaW (https://skk.moe)
* License: MIT
*
* @param {Object} Element selector for link
*/
(function(El) {
if (document.referrer && document.location.host && document.referrer.match(new RegExp("^https?://" + document.location.host))) {
@SukkaW
SukkaW / sw.js
Created October 28, 2018 07:15
Use workbox on jsDelivr
importScripts('https://cdn.jsdelivr.net/npm/workbox-cdn@3.6.3/workbox/workbox-sw.js');
workbox.setConfig({
modulePathPrefix: 'https://cdn.jsdelivr.net/npm/workbox-cdn@3.6.3/workbox/'
});
@SukkaW
SukkaW / no-disq.us.js
Last active October 20, 2018 17:05
Remove disq.us from Disqus Message
/* no-disq.us.js
* Author: Sukka (https://skk.moe)
* License: MIT
* Part of DisqusJS (https://suka.js.org/DisqusJS)
*
* @param {string} msg - 传入需要处理的 Disqus Comment rawMessage
* @return {string} - 解析完 disq.us 后的 Message
*/
let removeDisqUs = (msg) => {
// aMatcher - 只处理 Disqus 短链接
@SukkaW
SukkaW / npel.js
Last active October 20, 2018 08:54
新理念外语网络教学中心(NPEL)自动点击
/* npel.js | v0.1.2
* Author: Sukka (https://skk.moe)
* License: MIT
*
* Usage: 用电脑浏览器打开 新理念外语网络教学中心(推荐现代浏览器如 Chrome 或 Firefox)
* 点击需要学习的 Unit,按下 F12,找到 console,复制粘贴下述代码,并回车执行
* How it works: 用 setInterval 每 30s 点击一次 <body> 元素并计数,NPEL 监听的是全
* 局元素事件,不需要定位到 iframe
*/
window.i = 0;

Keybase proof

I hereby claim:

  • I am sukkaw on github.
  • I am sukka (https://keybase.io/sukka) on keybase.
  • I have a public key ASATNbNkxvEf1Hrc0AlrrsnZd4O7j-VnKXza7axwS3DIuQo

To claim this, I am signing this object: