Skip to content

Instantly share code, notes, and snippets.

@razumzhir0
razumzhir0 / docker-burn
Last active May 9, 2017 22:04
Docker Burn Script - Taken/modified from StackExchange, unsure of the post.
# echo 'stopping all containers...\n '
docker kill $(docker ps -q)
# echo 'removing all containers...\n '
docker rm $(docker ps -a -q)
# echo 'removing all docker images...\n '
docker rmi $(docker images -a -q)
# echo 'removing all docker volumes...\n '
@pablochacin
pablochacin / parse_query.sh
Last active January 27, 2023 01:32
A one liner to parse a http query string in bash
#
# the following one liner creates a shell variable from every parameter in a
# the query string in the variable QUERY, of the form p1=v1&p2=v2,... and sets it to
# the corresponding value so that parameters can be accessed by its name $p1, $p2, ...
#
for p in ${QUERY//&/ };do kvp=( ${p/=/ } ); k=${kvp[0]};v=${kvp[1]};eval $k=$v;done
@Ocramius
Ocramius / User.php
Last active February 16, 2024 14:57
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User