Smart 🧠 Fullstack
45 subscribers
168 photos
11 videos
13 files
153 links
About channel: everyday developer hints.

for (💲Coders as 💲Student):
echo("Hello 💲Student->name");
endfor;

Author: @BakirovRoman
Download Telegram
Inkscape Make Center

Ctrl + Shift + A


#svg
👍1
Debian 12 (bookworm)
Install PHP 8.4

sudo apt update
sudo apt install apt-transport-https lsb-release ca-certificates curl -y
sudo curl -sSLo /usr/share/keyrings/deb.sury.org-php.gpg https://packages.sury.org/php/apt.gpg
sudo sh -c 'echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'
sudo apt update
sudo apt install php8.4
php -v
sudo apt install php8.4-cli php8.4-fpm php8.4-mysql php8.4-curl php8.4-gd php8.4-xml php8.4-zip php8.4-mbstring php8.4-xml php8.4-gmp php8.4-pgsql


sudo systemctl stop apache2
sudo systemctl disable apache2
sudo apt remove apache2 apache2-bin apache2-common apache2-data -y
sudo apt autoremove -y
apache2 -v
sudo apt purge apache2* -y
sudo rm -rf /etc/apache2


sudo -u postgres pg_dump database_name > backup.sql

scp backup.sql user@second_server:/home/debian/

sudo -u postgres psql database_name < /home/debian/backup.sql

nano /etc/postgresql/*/main/pg_hba.conf
host all all 0.0.0.0/0 scram-sha-256

sudo nano /etc/postgresql/*/main/postgresql.conf
port = 5433

sudo sed -i "s/#listen_addresses = 'localhost'/listen_addresses = '*'/g" /etc/postgresql/*/main/postgresql.conf

sudo ufw allow 5559/tcp
// ==UserScript==
// @name Auto Refresh Page
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Обновляет страницу каждые 10 секунд
// @author You
// @match *://*/*
// @grant none
// ==/UserScript==

(function() {
'use strict';
setTimeout(() => {
location.href = location.href.split('?')[0] + '?nocache=' + Date.now();
}, 10000);
})();
alias gt='git-tag'
alias git-tag="git --no-pager tag | sort -V"
Steam Down
alias my-ip='curl ifconfig.io'
df -h
ncdu
https://claude.ai/favicon.svg

https://claude.ai/new?q=%s
// ==UserScript==
// @name Claude Auto Send
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Automatically clicks the send button on claude.ai/new?q=
// @author Romaxa
// @match https://claude.ai/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=claude.ai
// @grant none
// @run-at document-end
// ==/UserScript==

(function() {
'use strict';

// Check that we're on the correct page
if (!window.location.href.startsWith('https://claude.ai/new?q=')) {
return;
}

// Function to click the send button
function clickSendButton() {
const sendButton = document.querySelector('button[type="button"][aria-label="Send message"]');
if (sendButton) {
sendButton.click();
return true;
}
return false;
}

// Wait 0.5 seconds for the button to appear, then try to click it
setTimeout(function() {
if (clickSendButton()) {
return;
}

// If button still not found, use MutationObserver to track DOM changes
const observer = new MutationObserver(function(mutations) {
if (clickSendButton()) {
observer.disconnect();
}
});

// Start observing the entire document
observer.observe(document.body, {
childList: true,
subtree: true,
attributes: false,
characterData: false
});

// Timeout in case button never appears
setTimeout(function() {
observer.disconnect();
}, 5000);
}, 500);
})();
👎1
<?php

use Symfony\Component\VarDumper\Caster\ScalarStub;
use Symfony\Component\VarDumper\VarDumper;

function dump(mixed ...$vars): mixed
{
if (!MODE_DEBUG) return null;

$date = date('[Y-m-d H:i:s]');

if (!$vars) {
VarDumper::dump(new ScalarStub('❤️'), $date);
return null;
}

if (array_key_exists(0, $vars) && 1 === count($vars)) {
VarDumper::dump($vars[0], $date);
$k = 0;

} else {
VarDumper::dump('Several variables:', $date);
foreach ($vars as $k => $v) {
VarDumper::dump($v, is_int($k) ? 1 + $k : $k);
}
}

$backtrace = debug_backtrace(2);
echo $backtrace[0]['file'] . ':' . $backtrace[0]['line'] . PHP_EOL;

if (1 < count($vars)) {
return $vars;
}

return $vars[$k];
}
❤️ Happy New Year) 🥂
👍2