Skip to content

Instantly share code, notes, and snippets.

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

Sukka SukkaW

👓
Learning everything...
View GitHub Profile
@SukkaW
SukkaW / IATA.json
Created September 25, 2018 14:37
The JSON Format Airport Data
[{"iata":"UTK","iso":"MH","name":"UtirikAirport"},{"iata":"FIV","iso":"US","name":"FiveFingerCGHeliport"},{"iata":"FAK","iso":"US","name":"FalseIslandSeaplaneBase"},{"iata":"BWS","iso":"US","name":"BlaineMunicipalAirport"},{"iata":"WKK","iso":"US","name":"Aleknagik\/NewAirport"},{"iata":"TSS","iso":"US","name":"East34thStreetHeliport"},{"iata":"FOB","iso":"US","name":"FortBraggAirport"},{"iata":"ABP","iso":"PG","name":"AtkambaAirport"},{"iata":"ALV","iso":"AD","name":"AndorralaVellaHeliport"},{"iata":"ADC","iso":"PG","name":"AndakombeAirport"},{"iata":"TJP","iso":"PR","name":"AreopuertoInternacionalMichaelGonzalez"},{"iata":"AEE","iso":"SS","name":"AdareilAirport"},{"iata":"AEI","iso":"ES","name":"AlgecirasHeliport"},{"iata":"AEK","iso":"PG","name":"AsekiAirport"},{"iata":"OLR","iso":"AF","name":"SalernoLandingZoneAirport"},{"iata":"AFR","iso":"PG","name":"AforeAirstrip"},{"iata":"AFT","iso":"SB","name":"AfutaraAerodrome"},{"iata":"ATD","iso":"SB","name":"UruHarbourAirport"},{"iata":"VEV","iso":"SB","name":"B
@SukkaW
SukkaW / git-pull-gc.sh
Created October 4, 2018 12:13
在所有子目录中的 git repo 里执行 git pull 和 git gc
#!/bin/bash
find `pwd` -type d -name ".git" > git_dir.txt
sed -i "s/\/.git/\//g" git_dir.txt
while read LINE
do
echo $LINE
cd "$LINE"
git pull
@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;
@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 / 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 / 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))) {
#!/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 / 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

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)
}
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;
//视频是否静音