Skip to content

Instantly share code, notes, and snippets.

View DavidBadura's full-sized avatar
:electron:
coding...

David Badura DavidBadura

:electron:
coding...
View GitHub Profile
@DavidBadura
DavidBadura / FromRequestBody.php
Last active May 24, 2023 09:49
RequestBodyResolver
<?php
declare(strict_types=1);
namespace App\Share\Application\ArgumentResolver;
use Attribute;
#[Attribute(Attribute::TARGET_PARAMETER)]
class FromRequestBody
apt update
apt install ca-certificates curl gnupg lsb-release
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt update
apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
extern crate rand;
use rand::Rng;
use std::cmp::Ordering;
use std::net::UdpSocket;
use std::str;
fn main() {
let server = Server {
socket: UdpSocket::bind("0.0.0.0:34000").expect("couldn't bind to address"),
@DavidBadura
DavidBadura / DataListExtension.php
Created May 15, 2015 12:46
Symfony2 Datalist Extension
<?php
namespace AppBundle\Form\Extension;
use Symfony\Component\Form\AbstractTypeExtension;
use Symfony\Component\Form\FormInterface;
use Symfony\Component\Form\FormView;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**