Skip to content

Instantly share code, notes, and snippets.

View linkimfly's full-sized avatar
🤒
Out sick

linkimfly

🤒
Out sick
View GitHub Profile
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@linkimfly
linkimfly / site.js
Last active February 8, 2021 15:23
宝塔面板网站管理增强
var site_table = bt_tools.table({
el:'#bt_site_table',
url:'/data?action=getData',
param:{table:'sites'}, //参数
minWidth:'1000px',
autoHeight:true,
default:"站点列表为空",//数据为空时的默认提示
beforeRequest:function(param){
param.type = bt.get_cookie('site_type') || -1;
return param;
@linkimfly
linkimfly / bt.sh
Last active February 8, 2021 15:34
bt panel tools
#!/bin/sh
# 去除宝塔面板 添加网站时域名格式校验
sed -i "s/if not re.match(reg, self.siteName)/#if not re.match(reg, self.siteName)/g" /www/server/panel/class/panelSite.py
# 修改面板site.js
sed -i "s/{type:'checkbox',class:'',width:20},/{type:'checkbox',class:'',width:20},{fid:'id',title:'ID'},/g" /www/server/panel/BTPanel/static/js/site.js
# 清除面板缓存
@linkimfly
linkimfly / waitForKeyElements.js
Last active October 10, 2020 14:12 — forked from BrockA/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@linkimfly
linkimfly / wait-for-elements.js
Created September 28, 2020 12:32 — forked from alexcontes/wait-for-elements.js
Wait for elements
/**
* @param sel - the selector you want to wait for
* @param action - the callback that will be executed when element/s matching the given selector are found, it is passed the array of found elements
* @param stopLooking - if true the function will stop looking for more elements after the first match
*/
function waitForElems(sel, action, stopLooking) {
var tick;
var id = 'fke' + Math.floor(Math.random() * 12345);
var type = window.MutationObserver ? 'M' : 'S';
var lastMutation = Date.now();
@linkimfly
linkimfly / waitForKeyElements.js
Created September 15, 2020 23:33 — forked from mjblay/waitForKeyElements.js
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content. Forked for use without JQuery.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
//--- Page-specific function to do what we want when the node is found.
function commentCallbackFunction (element) {
element.text ("This comment changed by waitForKeyElements().");
@linkimfly
linkimfly / nginx.conf
Created March 9, 2020 13:35 — forked from terrywang/nginx.conf
nginx config file template for Debian and Ubuntu
# User and group used by worker processes
user www-data;
# Ideally # of worker processes = # of CPUs or cores
# Set to auto to autodetect
# max_clients = worker_processes * worker_connections
worker_processes auto;
pid /run/nginx.pid;
@linkimfly
linkimfly / filter.d_nginx-auth.conf
Created December 3, 2019 09:13 — forked from JulienBlancher/filter.d_nginx-auth.conf
Fail2ban Config with Nginx and SSH
#
# Auth filter /etc/fail2ban/filter.d/nginx-auth.conf:
#
# Blocks IPs that makes too much accesses to the server
#
[Definition]
failregex = ^<HOST> -.*"(GET|POST).*HTTP.*"
ignoreregex =
<?php
use Carbon\Carbon;
use Carbon\CarbonPeriod;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
@linkimfly
linkimfly / github-languages-stats.json
Created June 2, 2019 13:00 — forked from paulmillr/github-languages-stats.json
Most active GitHub users raw data
{
"Total": 963
}