Skip to content

Instantly share code, notes, and snippets.

@aokhrimenko
aokhrimenko / private_fork.md
Created July 8, 2022 17:53 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@aokhrimenko
aokhrimenko / BeforeCrudActionSubscriber.php
Last active May 11, 2022 10:08
Add "Quick create" option for Association fields. Works only with Doctrine ORM mapping in attributes and Uuid as entity identifier. The idea is to create new entity if submitted value is not a valid Uuid.
<?php
namespace App\EventSubscriber;
use App\Entity\SimpleCreate;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\Persistence\ManagerRegistry;
use EasyCorp\Bundle\EasyAdminBundle\Config\Action;
use EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext;
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Controller\CrudControllerInterface;
@aokhrimenko
aokhrimenko / cf_wrangler_context_shell_function.sh
Last active July 6, 2021 15:21
Simple Cloudflare's Wrangler context switcher
function wrangler_context() {
local dir=~/.wrangler/config
local ctx=$1
local file="${dir}/${ctx}.toml"
if [[ -z "$ctx" ]];then
echo "Current wrangler contexts read from ${dir}"
echo
ls -1 $dir |grep -v default |cut -d . -f 1
echo
return
#!/bin/bash
# Originally written by Ralf Kistner <[email protected]>, but placed in the public domain
set +e
bootanim=""
failcounter=0
timeout_in_sec=360