Skip to content

Instantly share code, notes, and snippets.

View bitcreator's full-sized avatar

Hennadii Tarasenko bitcreator

  • Ukraine, Rzhyshchiw
View GitHub Profile
@bpolaszek
bpolaszek / bootstrap.php
Last active July 24, 2024 09:24
Symfony shortcuts for Pest
<?php
# tests/bootstrap.php
declare(strict_types=1);
namespace App\Test;
use ApiPlatform\Core\Bridge\Symfony\Bundle\Test\Client;
use App\Entity\User;
use App\Kernel;
@icebob
icebob / k3s_helm_install.sh
Last active July 21, 2024 00:59
K3S + Helm installing
# Install K3S
curl -sfL https://get.k3s.io | sh -
# Copy k3s config
mkdir $HOME/.kube
sudo cp /etc/rancher/k3s/k3s.yaml $HOME/.kube/config
sudo chmod 644 $HOME/.kube/config
# Check K3S
kubectl get pods -n kube-system
@zmts
zmts / tokens.md
Last active September 18, 2024 17:08
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@codeliner
codeliner / MongoConnection.php
Last active May 9, 2022 14:55
prooph MongoEventStore v7
<?php
declare(strict_types = 1);
namespace Acme\Infrastructure\MongoDb;
use MongoDB\Client;
use MongoDB\Collection;
class MongoConnection
@corny
corny / journal.go
Last active June 15, 2023 20:37
SQLite journal in Go (golang)
/*
Stores entries in a local SQLite database
until they have been processed by a submit function.
*/
package journal
import (
"database/sql"
_ "github.com/mattn/go-sqlite3"
"sync"
@alexander-schranz
alexander-schranz / SuluExtendController.php
Last active December 29, 2021 15:19
Custom sulu controller which load some data from a service
<?php
namespace App\Controller\Website;
use Sulu\Bundle\WebsiteBundle\Controller\WebsiteController;
use Sulu\Component\Content\Compat\StructureInterface;
/**
* Controller which needs a custom service to add data to render twig template.
*/
@charliepage88
charliepage88 / symfonyCSV.html.twig
Created February 16, 2013 20:23
Symfony 2 CSV Export
id, field1, field2, field3
{% for row in data %}
{{ row.id }},{{ row.field1 }},{{ row.field2 }},{{ row.field3 }}
{% endfor %}
@vladcosorg
vladcosorg / SluggableListener.php
Created December 9, 2012 13:48
Symfony2 russian transliterator for Sluggable
<?php
namespace Your\Bundle\Misc;
class SluggableListener extends \Gedmo\Sluggable\SluggableListener
{
public function __construct(){
$this->setTransliterator(array('\Your\Bundle\Misc\Transliterator', 'transliterate'));
}
@iros
iros / API.md
Created August 22, 2012 14:42
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@ziadoz
ziadoz / awesome-php.md
Last active July 13, 2024 05:29
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.