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
/* This code make for Ukrainian language only. | |
Перетвоює пару В-У в строках відповідно до правила милозвучності української мови. | |
Перетворює «в» на «у» чи навпаки, залежно від контексту (наявності голосних-приголосних поруч). | |
Фаворит Експертів в номінації --> Фаворит Експертів у номінації | |
Фаворит Успіху у номінації --> Фаворит Успіху в номінації | |
*/ | |
function mielophone($s, $l = false) { | |
global $lang; | |
if (!$l) $l = $lang; |
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
<style> | |
/* Original idea of styling peeped at https://codersblock.com/blog/checkbox-trickery-with-css/ */ | |
input[type="checkbox"], | |
input[type="radio"] { | |
position: absolute; | |
left: -9999px; | |
} | |
.check-label, |
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
// The unicode-safe ucwords() func for JS (to capitalize the first characters of words), | |
// which additionally respects double-lastnames like Russian Засс-Ранцев and weird French names, | |
// like Honoré de Balzac and d'Artagnan. | |
String.prototype.ucwords = function() { | |
return this.toLowerCase() | |
.replace(/(^|\s|\-)[^\s$]/g, function(m) { | |
return m.toUpperCase(); | |
}) | |
// French, Arabic and some noble names... |
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
// This is replacement for regular localStorage or sessionStorage objects, | |
// if they blocked by some paranoiac browser, like Brave with default settings.... | |
var expireStorage = { | |
length: function() { | |
return data.length; | |
}, | |
key: function(key) { | |
return Object.keys(data)[key]; | |
}, |
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
:: See also "set-background-color.bat". | |
:: Sometimes, when you're using the best performance settings, with no shadows under icon labels, | |
:: it's important to specify the solid background-color too, to display the contrast color for the icon labels. | |
:: If your primary wallpaper color is dark, set the solid color to black (000000). When it's light -- set solid color to white (ffffff). | |
@echo off | |
if [%1]==[] ( | |
echo USAGE: set-wallpaper.bat [full/path/to/filename.jpg] | |
exit |
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
:: See also set-wallpaper.bat | |
@echo off | |
if [%1]==[] ( | |
echo USAGE: set-background-color.bat [6 hexadecimal digit color value] | |
echo EXAMPLE: "set-background-color.bat ffffff". This will set background color to white. | |
exit | |
) |
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
// see also is_valid_email() in "strings.php". | |
String.prototype.isValidEmail = function() { | |
// This all are valid accordingly to RFC: !#$%&'*+-/=?^_`{|}~ | |
// Gmail use + for subadressing. Usage of other special chars in unknown, but they are still valid anyway. | |
// Double-dot, however (..) is not allowed. | |
return 0 <= this.indexOf("..") | |
? false // email can't have 2 dots at row | |
: /^([\w!#$%&'*+\-/=?^_`{|}~]+(?:\.[\w!#$%&'*+\-/=?^_`{|}~]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,30}(?:\.[a-z]{2})?)$/i.test(this.trim()); // the longest domain extension in 2015 was ".cancerresearch", and looks like it's not the limit. UPD. how about .travelersinsurance? I set up it the longest domain extension to 30 chars. | |
} |
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(window) { | |
// lStorage & sStorage -- replacements for localStorage and sessionStorage | |
// =========================== | |
// Brave browser (withe default settings) is blocking access to localStorage. | |
// This is sucks, but in most cases we can live without stored data. Just don't let exception prevent execution of our code. | |
// =========================== | |
/* IDEA: | |
* We have replacement for any storage, that lives only during current instance. (Even less than session.) | |
* We use this replacement only if regular storage not found. (And this is the only sense to use it.) |
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
(async () => { | |
const puppeteer = require('puppeteer'), | |
fs = require('fs').promises, | |
// Generate 2-letter combinations | |
generateCombinations = x => { | |
const combinations = [], | |
// Small latin letters and digits | |
characters = [...Array(26).keys()].map(i => String.fromCharCode(i + 97)) | |
.concat([...Array(10).keys()].map(i => i.toString())); |
OlderNewer