sudo code /usr/local/etc/httpd/extra/httpd-vhosts.conf (WSL: sudo nano /etc/apache2/sites-available/000-default.conf)
sudo code /etc/hosts
sudo apachectl -k restart (WSL: sudo service apache2 restart)
| <?php | |
| $benchmark_time = microtime(1); | |
| $benchmark_string = ''; | |
| function benchmark( $string = ''){ | |
| global $benchmark_time, $benchmark_string; | |
| $return = sprintf('%f', microtime(1) - $benchmark_time) . 's ' . $benchmark_string; | |
| $benchmark_time = microtime(1); | |
| $benchmark_string = $string; | |
| return $return; |
| /** | |
| * Magic Copy | |
| * This little script will append some text to the clipboard when a user copies text from the website | |
| * | |
| * WARNING: This feature is an anti-pattern and a bad usability practice in 99% of cases, use only in | |
| * those situations where it can really benefit the user to have a link to the full resource | |
| */ | |
| document.addEventListener('copy', (event) => { | |
| if (document.getSelection().toString().length < 10){ return; } | |
| const pagelink = `\n${document.location.href}`; |
| // Given a Date object | |
| var d = new Date(); | |
| // Full date and time | |
| // Wed Jan 15 2020 17:31:39 GMT+0100 (Central European Standard Time) | |
| var output = d; | |
| // Timestamp | |
| var output = d.getTime() |
| -- Exclude outliers while trying to get the average | |
| SELECT AVG(price) FROM transactions WHERE ABS(price - (SELECT AVG(price) FROM transactions) < 3*(SELECT stddev(price) from transactions)); | |
| <?php | |
| /* Database Backup to email by Xavi Esteve */ | |
| // ====================================== | |
| // ======== MODIFY SETTINGS HERE ======== | |
| // ====================================== | |
| $config = [ | |
| // MySQL | |
| 'db_host' => 'localhost', | |
| 'db_user' => null, // default, used if nothing declared in 'databases' |
| /** | |
| clearInterval(t);var t = setInterval(function(){run()}, 100); | |
| */ | |
| var run = function(){ | |
| // Make paperclip | |
| // Clicks the 'Make paperclip' button, useful at the very beginning of the game | |
| var wire = parseInt(document.querySelector('#wire').innerText); | |
| if (wire > 0){ | |
| for (let index = 0; index < 100; index++) { |
| javascript: | |
| /*! ReadingMode © Xavi Esteve */ | |
| (function (d) { | |
| var el = d.getElementsByTagName("*"); | |
| var htmlDiv = d.createElement("div"); | |
| var readingModeMenu = d.createElement("div"); | |
| var readingModeAlert = d.createElement("div"); | |
| var title = d.title; | |
| var rmSettings = {}; |
| $ = function(sel, ctx){return (ctx || document).querySelector(sel)} | |
| $$ = function(sel, ctx){return (ctx || document).querySelectorAll(sel)} |
| /*! Tiny jQuery Notify by Xavi Esteve © 2018 MIT */ | |
| /* | |
| { | |
| text: string | |
| type: success, error, warning, danger... any CSS class you want to add | |
| } | |
| notify({text: 'Hello world!', type: 'success' }); | |
| */ | |
| var timers = []; |