sudo yum update
sudo yum install gnome-tweak-tool
// if Navigation Timing is not supported, fallback to Date.naw() called on start (sufficient in many cases) | |
// Date.now is also polyfilled | |
(function(p){ | |
if(!Date.now) | |
Date.now = function(){return +new Date}; | |
if (!p.now){ | |
var start = (p.timing && p.timing.navigationStart) || Date.now(); | |
p.now = function now(){ | |
return Date.now() - start; |
/** | |
* Register ajax transports for blob send/recieve and array buffer send/receive via XMLHttpRequest Level 2 | |
* within the comfortable framework of the jquery ajax request, with full support for promises. | |
* | |
* Notice the +* in the dataType string? The + indicates we want this transport to be prepended to the list | |
* of potential transports (so it gets first dibs if the request passes the conditions within to provide the | |
* ajax transport, preventing the standard transport from hogging the request), and the * indicates that | |
* potentially any request with any dataType might want to use the transports provided herein. | |
* | |
* Remember to specify 'processData:false' in the ajax options when attempting to send a blob or arraybuffer - |
(function () { | |
'use strict'; | |
if (location.host !== 'daynhauhoc.com') { | |
const checkHost = confirm('Bookmarklet does not work on this page.\nDo you want to open DayNhauHoc?'); | |
if (checkHost) top.location.href = 'https://daynhauhoc.com'; | |
return; | |
} | |
if (!Discourse.User.current()) { |
-- Adminer 4.3.1 MySQL dump | |
SET NAMES utf8; | |
SET time_zone = '+00:00'; | |
SET foreign_key_checks = 0; | |
SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO'; | |
DROP TABLE IF EXISTS `districts`; | |
CREATE TABLE `districts` ( | |
`id` char(3) COLLATE utf8_unicode_ci NOT NULL, |
(function ($) { | |
var arr = []; | |
$('table[style="width:800px; border-collapse: collapse;"] tr').each(function () { | |
var $this = $(this), | |
$a = $this.find('a:first'); | |
if($a.length) arr.push("'" + $this.find('a:last').text().toLowerCase().replace(/(\s|\W)/g, '-') + "' => '" + $a.attr('title') + "'"); | |
}); | |
console.log(arr.join(',\n')); | |
})(jQuery); |
(function () { | |
fetch('/level/1', { | |
credentials: 'same-origin' | |
}).then(function (response) { | |
return response.text(); | |
}).then(function (response) { | |
$('#password').val(response.match(/Password:\s+([\d\-]+)/)[1]); | |
}); | |
})(); |
.wrap { | |
margin: 30px auto; | |
width: 90%; | |
font-family: 'Tahoma', san-serf; | |
font-size: 14px; | |
} | |
.title { | |
font-size: 1.7em; | |
font-weight: lighter; |
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); |