Skip to content

Instantly share code, notes, and snippets.

View deniskorbakov's full-sized avatar
:octocat:
sleep

Denis deniskorbakov

:octocat:
sleep
View GitHub Profile
@deniskorbakov
deniskorbakov / example.php
Created November 5, 2025 06:45
Laravel interview
<?php
declare(strict_types=0);
use App\DTO\User\ShowDTO;
use App\DTO\User\UpdateDTO;
use App\Models\User;
use App\Services\User\UserService;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\Facades\Hash;
@deniskorbakov
deniskorbakov / term.bash
Created October 4, 2025 07:03
Software confirmation on macOS
# Apple не удалось подтвердить, что файл «cli» не содержит вредоносного ПО,
# которое может нанести вред Вашему Mac или конфиденциальности Ваших данных.
# Apple could not confirm that the "cli" file does not contain malware,
# which may harm your Mac or the privacy of your data.
xattr -d com.apple.quarantine path_your_app
@deniskorbakov
deniskorbakov / cheat_sheet .go
Last active November 5, 2025 06:47
Go I/O Cheat Sheet
package main
//Reading from stdin:
var input string
fmt.Scanln(&input)
fmt.Println("Введено:", input)
//Reading all of stdin:
data, _ := io.ReadAll(os.Stdin)
@deniskorbakov
deniskorbakov / pest_acting_as_api.php
Last active November 5, 2025 06:47
Pest -> actingAs() for api token
<?php
// tests/TestCase.php
abstract class TestCase extends BaseTestCase
{
protected ?string $apiToken = null;
protected function actingAsApi(User $user): self
{
if ($this->apiToken) {
@deniskorbakov
deniskorbakov / reset.sh
Last active November 5, 2025 06:48
reset trial jetbrains on mac
#!/bin/bash
if [ "$1" = "--prepare-env" ]; then
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
mkdir -p ~/Scripts
echo "Copying the script to $HOME/Scripts"
cp -rf $DIR/runme.sh ~/Scripts/jetbrains-reset.sh
chmod +x ~/Scripts/jetbrains-reset.sh
@deniskorbakov
deniskorbakov / generate_rsa_ssh_keys.go
Created June 22, 2025 13:36 — forked from goliatone/generate_rsa_ssh_keys.go
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@deniskorbakov
deniskorbakov / geo.js
Created May 19, 2025 14:12 — forked from mkhatib/geo.js
A Javascript utility function to generate number of random Geolocations around a center location and in a defined radius.
/**
* Generates number of random geolocation points given a center and a radius.
* @param {Object} center A JS object with lat and lng attributes.
* @param {number} radius Radius in meters.
* @param {number} count Number of points to generate.
* @return {array} Array of Objects with lat and lng attributes.
*/
function generateRandomPoints(center, radius, count) {
var points = [];
for (var i=0; i<count; i++) {
@deniskorbakov
deniskorbakov / sshclient.go
Created May 14, 2025 21:27 — forked from Mebus/sshclient.go
Golang SSH Client
package main
import (
"bufio"
"io/ioutil"
"os/signal"
//"syscall"
"fmt"
"log"
"os"
@deniskorbakov
deniskorbakov / reset_jetbrains_trial.sh
Created June 23, 2024 14:12 — forked from XGilmar/reset_jetbrains_trial.sh
Script JetBrains trial reset
#!/bin/bash
# Colors for terminal output
RED='\033[0;31m'
GREEN='\033[0;92m'
YELLOW='\033[0;33m'
BLUE='\033[0;94m'
PURPLE='\033[0;95m'
CYAN='\033[1;96m'
WHITE='\033[0;97m'