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', 'ŵ', 'Ŷ', 'ŷ', 'Ÿ', 'Ź', 'ź', 'Ż', 'ż', 'Ž', 'ž', 'ſ', 'ƒ', 'Ơ', 'ơ', 'Ư', 'ư', 'Ǎ', 'ǎ', 'Ǐ', 'ǐ', 'Ǒ', '
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/sh | |
# | |
# /etc/init.d/swoole-prod | |
# | |
# Example of init script for UNIX daemon | |
# | |
# chkconfig: 2345 20 80 | |
# description: Example of UNIX daemon | |
### BEGIN INIT INFO |
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
// ==UserScript== | |
// @name YouTube InstantView customization | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author Andrei Telteu | |
// @match https://www.youtube.com/* | |
// @grant none | |
// ==/UserScript== |
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
UPDATE `core_config_data` | |
SET `value` = REPLACE(value, 'old-domain.com', 'new-domain.com') | |
WHERE `path` LIKE '%secure/base_url%' OR `path` = 'web/cookie/cookie_domain' | |
// with regex | |
UPDATE `subcategories` SET `name` = REGEXP_REPLACE(name,'^(.*)$','{"ro":"\\1","en":"\\1"}') |
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 | |
// install composer require phpseclib/phpseclib:~2.0 | |
// https://github.com/phpseclib/phpseclib | |
$rsa = new \phpseclib\Crypt\RSA(); | |
$rsa->setPassword($password); | |
$rsa->setPrivateKeyFormat(\phpseclib\Crypt\RSA::PUBLIC_FORMAT_OPENSSH); | |
$rsa->setPublicKeyFormat(\phpseclib\Crypt\RSA::PUBLIC_FORMAT_OPENSSH); | |
$rsa->setComment('robot@laravel.com'); | |
$keys = $rsa->createKey(4096); |
If you are developing with the wordpress theme starter kit roots/sage, and you want to specify a custom ssl certificate for the dev proxy when you run yarn start
, add the ssl certs this way:
Open \wp-content\themes\your-sage-theme\resources\assets\build\webpack.config.watch.js
Add the advanced.browserSync config after delay:
new BrowserSyncPlugin({
target,
open: config.open,
Create a new file called temps
in a folder that is included in PATH (example nano .local/bin/temps
)
#!/bin/bash
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# source: https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/
# modified by: Andrei Telteu https://gist.github.com/AndreiTelteu/11dae86616b48578a8e8649802414aaa
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
hdd=/dev/sda # lsblk -d to see all
In your theme's functions.php
file, or in a custom plugin insert this code:
<?php
add_filter( 'rank_math/frontend/title', function( $title ) {
$translatepress_translation = custom_get_translatepress_translation($title);
if ($translatepress_translation != null) {
$title = $translatepress_translation;
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
<div id="app"> | |
{{-- this loader gets automatically replaced by the react app after loading --}} | |
<div style="background:#1C9EF2; width:100vw; height:100vh;"> | |
<div id="loading" style="position: absolute; top:46%; left:50%; transform: translateX(-50%) translateY(-50%); text-align: center;"> | |
<img src="/images/logo-white.png"><br> | |
<div style="display: inline-block; width: 80px; height: 80px; border-radius: 100%; background: white; display: flex; margin: auto; align-items: center; justify-content: center; margin-top: 20px;"> | |
<img src="/images/loader.svg" style="width: 50px; height: 50px; margin-bottom: 10px;"> | |
</div> |
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 | |
$source_path = 'super-long-image.png'; | |
$destination_path = 'new-image.png'; | |
$parts = 3; // in how many parts you want to split the image | |
$source = imagecreatefrompng($source_path); | |
$width = imagesx($source); | |
$height = imagesy($source); | |
$newWidth = $width / $parts; | |
$newHeight = $height * $parts; |