Skip to content

Instantly share code, notes, and snippets.

@wonzbak
wonzbak / config.txt
Created October 16, 2021 15:36
Raspberry pi Config for WIMAXIT 7 hdmi screen
# Config for WIMAXIT 7
hdmi_force_edit_audio=1
max_usb_current=1
hdmi_force_hotplug=1
config_hdmi_boost=7
hdmi_group=2
hdmi_mode=87
hdmi_drive=2
display_rotate=0
hdmi_cvt 1024 600 60 6 0 0 0
<?php
declare(strict_types=1);
namespace Deezer\Legacy\Test\ActivationJourney;
use Prophecy\Prophet;
class MockHelper
{
@wonzbak
wonzbak / timeIt.php
Last active January 13, 2020 10:16
Get time elapse of a function
<?php
function timeIt(
callable $callable,
array $params = [],
int $maxLoop = 1000,
bool $returnValue = false
) {
$start = microtime(true);
# CORS
Header always set Access-Control-Allow-Origin "*"
Header always set Access-Control-Allow-Headers "Content-Type, Authorization"
Header always set Access-Control-Request-Methods "POST, GET, OPTIONS"
<?php
/**
* Unaccent a string
*
* An example string like ÀØėÿᾜὨζὅБю will be translated to AOeyIOzoBY.
* More complete than :
*
* strtr(
* (string)$str,
@wonzbak
wonzbak / mailer.php
Created March 16, 2018 16:19
Mailer High level class
<?php
namespace Mail;
/**
* Class Mailer
*
* Class to send email.
*
*/
@wonzbak
wonzbak / release.sh
Last active June 5, 2017 14:30
bash script to prepare release with git
#!/bin/bash
CHANGELOG_FILENAME="CHANGELOG.rst"
LASTTAG=$(git tag| sort -V | tail -1)
echo "Last tag $LASTTAG"
TMPFILE=$(mktemp)
TODAY=$(date +%Y-%m-%d)
@wonzbak
wonzbak / index.html
Created March 25, 2017 09:40
Html template
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Title</title>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
</head>
<body>
<div id="container">
@wonzbak
wonzbak / vimrc.minimal
Created March 6, 2017 15:13
Vim minimal config file
set shell=/bin/sh " fish friendly
"
" Base configuration from https://github.com/tpope/vim-sensible
"
if has('autocmd')
filetype plugin indent on
endif
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
@wonzbak
wonzbak / log.sh
Created February 15, 2017 10:56
colorized logs
#!/usr/bin/env bash
# colorize log thanks to Radu Cotescu (https://radu.cotescu.com/coloured-log-outputs/)
TAIL=`which tail`
AWK=`which awk`
if [[ -z $TAIL ]]; then
echo -e "Cannot find tail executable.\n"
exit 1
fi