Skip to content

Instantly share code, notes, and snippets.

@Clindbergh
Clindbergh / loading-fixture-file-in-phpunit-test.md
Last active October 26, 2020 08:28
Load single Alice-fixture.yml in phpunit test with symfony
@Clindbergh
Clindbergh / importProdSfDbToTest
Created June 25, 2020 17:41
Exports a database from a symfony production environment and imports it in a test environment using the database strings declared in the .env files.
#!/bin/bash
prodDbString=$(grep "DATABASE_URL" //httpdocs/prodEnv/releases/current/.env.local)
testDbString=$(grep "DATABASE_URL" //httpdocs/testEnv/releases/current/.env)
function readDbCredentials {
user=$(grep -oP "(?<=mysql\:\/\/)\w+(?=\:)" <<< $1)
pw=$(grep -oP "(?<=mysql\:\/\/$user\:).*(?=\@)" <<< $1)
db=$(grep -oP "\w+$" <<< $1)
@Clindbergh
Clindbergh / iotcam.py
Last active January 21, 2021 11:31 — forked from loleg/iotcam.py
Detects barcodes from a webcam stream using Python, zbarlight and CV2
#####################################
# This version works on python 3 #
# Install pillow, zbarlight and cv2 #
#####################################
from picamera.array import PiRGBArray
from picamera import PiCamera
import time
import sys
import cv2