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 / 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
}