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
)
// 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 = []; |
#!/bin/bash | |
# Check Disk Space and send an HTTP request when it reaches the limit | |
# Once used space is higher than this limit, the webhook will be triggered (in percentage) | |
LIMIT='80' | |
# Stores the percentage of used space | |
USED=`df . | awk '{print $5}' | sed -ne 2p | cut -d"%" -f1` | |
# Webhook URL |
<?php | |
// config.php | |
$config['language'] = []; | |
$config['language']['default'] = 'en'; // no file for this language exists, will be just echoed as is | |
$config['language']['list'] = [ | |
'en' => '🇺🇸 English', | |
'es' => '🇪🇸 Español', | |
]; |