app/
- head.tsx
- layout.tsx
- page.tsx
- blog/[slug]/page.tsx
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
<?php | |
/** | |
* Multibyte String Pad | |
* | |
* Functionally, the equivalent of the standard str_pad function, but is capable of successfully padding multibyte strings. | |
* | |
* @param string $input The string to be padded. | |
* @param int $pad_length The length of the resultant padded string. | |
* @param string $pad_string The string to use as padding. Defaults to space. |
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
(для Debian пути и команды могут отличаться) | |
sudo apt-get --purge remove mariadb* | |
sudo apt-get autoremove | |
sudo apt-get autoclean | |
если возникают ошибки при удалении - | |
заходим в папку /var/lib/dpkg/info | |
и удаляем там всё что начинается на mariadb и на mysql | |
повторяем предыдущие три команды |
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
/** | |
* ECMA2015 | |
*/ | |
function convertHex(hexCode, opacity = 1){ | |
var hex = hexCode.replace('#', ''); | |
if (hex.length === 3) { | |
hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2]; | |
} |
This gist has two files in it: first-names.txt and last-names.txt, each with 4096 names taken from some unnamed database.
Useful for generating mock data for testing or for opfuscating production data for testing.
See https://stackoverflow.com/a/50242368/15109 for some thoughts about data obfuscation.
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
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
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
# | |
# Given a useragent string, return these results: | |
# Android version, device model name, type (tablet/phone) | |
# | |
import re | |
def android_details (useragent): | |
result = {} | |
result["aVersion"] = "Other" | |
result["amake"] = "Other" |
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
import smtplib | |
import sys | |
import email.mime.text | |
mail_username='gmailUser@gmail.com' | |
mail_password='password' | |
from_addr = mail_username | |
to_addrs=('gmailUser@gmail.com') | |
HOST = 'smtp.gmail.com' | |
PORT = 25 |
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
import smtplib | |
to = '22.22@22.com' | |
gmail_user = '22222@gmail.com' | |
gmail_pwd = '22222' | |
smtpserver = smtplib.SMTP("smtp.gmail.com",587) | |
smtpserver.ehlo() | |
smtpserver.starttls() | |
smtpserver.ehlo | |
smtpserver.login(gmail_user, gmail_pwd) |
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
dir -Include *.js -Recurse | Measure-Object -Line -Character -Word -IgnoreWhiteSpace |
NewerOlder