This file contains 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 hexToRgbTransformer(originalHex) { | |
const redChannel = parseInt(originalHex.slice(1, 3), 16); | |
const greenChannel = parseInt(originalHex.slice(3, 5), 16); | |
const blueChannel = parseInt(originalHex.slice(5, 7), 16); | |
return { red: redChannel, green: greenChannel, blue: blueChannel }; | |
}; | |
function rgbChannelToHex(colorChannel) { | |
const positiveChannelValue = Math.max(0, colorChannel); |
This file contains 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
#!/bin/bash | |
# | |
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script: | |
# | |
# 1) Replace Whisker icon to "format-justify-fill"; | |
# 2) Settings -> Apparence -> Select Dark theme and icons and enable toggle for matching xfce themes; | |
# 3) Settings => Keyboard => App Shortcuts => Add "/usr/bin/flameshot gui" => Print Screen => Keep Flameshot; | |
# 4) Reduce Workspaces to 1; | |
# 5) Configure energy settings to 15 min blank screen, 60min suspend; | |
# 6) Add the following itens to Whisker menu as favorites: |
This file contains 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
#!/bin/bash | |
# | |
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script: | |
# | |
# 1) Replace Whisker icon to "format-justify-fill" and configure to show as list. Check boxes 2 and 4 on General tab; | |
# 2) Settings -> Apparence -> Select Dark theme and icons; | |
# 3) Settings => Keyboard => App Shortcuts => Add "/usr/bin/flameshot gui" => Print Screen => Keep Flameshot; | |
# 4) Adjust clock layout to hour + date; | |
# 5) Reduce Workspaces to 1 and remove unecessary launchers from tray; | |
# 6) Add the following itens to Whisker menu as favorites: |
This file contains 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 humanReadableBytesAdapter(rawBytesQuantity: number): string { | |
const bytesUnits = ['bytes', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; | |
let unitSuffixIndex = 0; | |
const isQuantityNegative = rawBytesQuantity < 0; | |
const rawBytesQuantityAbsolute = Math.abs(rawBytesQuantity); | |
let shortestBytesNumeral = rawBytesQuantityAbsolute; | |
while (shortestBytesNumeral >= 1024 && unitSuffixIndex < bytesUnits.length - 1) { | |
shortestBytesNumeral /= 1024; |
This file contains 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
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains 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
#!/bin/bash | |
# | |
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script: | |
# | |
# 1) a) Replace Menu Lite with Whisker; | |
# b) All Icons - Search "format-justify-fill"; | |
# | |
# 2) Settings -> Apparence -> Select Dark Mode; | |
# | |
# 3) Settings => Keyboard => App Shortcuts => Add "/usr/bin/flameshot gui" => Print Screen => Keep Flameshot. |
This file contains 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
#!/bin/bash | |
# | |
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script: | |
# | |
# 1) Enable "Large Text" on Accessibility menu; | |
# | |
# 2) Settings => Keyboard => App Shortcuts => Add "/usr/bin/flameshot gui" => Print Screen => Keep Flameshot. | |
# | |
# 3) Configure AutoSSH for proxies. | |
# |
This file contains 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
#!/bin/bash | |
# | |
# The script will perform most of the steps, however, you must edit a few settings manually AFTER running the script: | |
# | |
# 1) a) Replace Menu Lite with Whisker; | |
# b) Panel Preferences => Row Size 48px; | |
# c) All Icons - Search "format-justify-fill"; | |
# b) Move bar to the top. | |
# | |
# 2) a) Settings -> Apparence -> Select Dark Mode; |
This file contains 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
#!/bin/bash | |
file=${1} | |
for extension in png jpeg jpg gif bmp; do | |
for image in `grep -ho "data:image/${extension};base64,[A-Za-z0-9+/=]*" ${file}`; do | |
image_signature=$(echo ${image} | md5sum | awk '{print $1}') | |
echo ${image} > ${image_signature}.hash | |
rm -f to-replace.script | |
echo "s|$(cat ${image_signature}.hash)|/wp-content/uploads/${image_signature}.${extension}|g" > to-replace.script | |
sed -i -f to-replace.script ${file} | |
sed -i "s|data:image/${extension};base64,||g" ${image_signature}.hash |
This file contains 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
<ifModule mod_headers.c> | |
Header always set Content-Security-Policy "upgrade-insecure-requests;" | |
</IfModule> |
NewerOlder