This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.toaster { | |
display: block; | |
position: fixed; | |
left: 50%; | |
transform: translateX(-50%); | |
bottom: 16px; | |
width: 100%; | |
height: 0; | |
z-index: 11; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from "vue"; | |
function setupWatchers(data = []) { | |
if (!(this instanceof Vue)) throw new Error("Persistence plugin needs to be called from a Vue component"); | |
if (!data) return; | |
const query = new URLSearchParams(location.search); | |
data.forEach((name) => { | |
const key = `${this.$options.name}_${name}`; | |
if (query.has(key)) this[name] = JSON.parse(query.get(key)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function buildReport() { | |
const ss = SpreadsheetApp.getActive(); | |
const data = ss.getSheetByName('SUMMARY').getRange("A1").getValues(); | |
const payload = buildAlert(data); | |
Logger.log(data); | |
sendAlert(payload); | |
} | |
function buildAlert(data) { | |
const mrr = data[0][0]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const ordinal = (num) => { | |
const suffix = ['th', 'st', 'nd', 'rd'] | |
const value = val % 100 | |
return val + (suffix[(value - 20) % 10] || suffix[value] || suffix[0]) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const prettier = require("prettier"); | |
const pluginName = "HandleChunkLoadFailurePlugin"; | |
/** | |
* This Webpack plugin calls `window._chunkHandler.handleVersionChange()` when loading a chunk fails | |
*/ | |
class HandleChunkLoadFailurePlugin { | |
constructor(options = {}) { | |
this.options = Object.assign({}, options); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Command to check access count per unique IP | |
tail -n 10000 /var/log/apache2/access.log | awk '{print $1}'| sort| uniq -c| sort -nr| head -n 10 | |
# Command to check access per unique pathname | |
awk {'print $7'} /var/log/apache2/access.log | sort -nk1 | uniq -c | less |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT table_schema | |
AS "Database", SUM(data_length + index_length) / 1024 / 1024 | |
AS "Size (MB)" | |
FROM information_schema.TABLES | |
GROUP BY table_schema; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crypto from 'crypto' | |
const generateChecksum = str => | |
crypto | |
.createHash('sha256') | |
.update(str, 'utf8') | |
.digest('base64') | |
const script = | |
'if (localStorage.getItem("theme")) document.documentElement.dataset.theme = localStorage.getItem("theme")' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prune all log files whose modified time is older than 6 days | |
find /var/log -mindepth 1 -mtime +5 -delete |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.