Skip to content

Instantly share code, notes, and snippets.

View CauanCabral's full-sized avatar

Cauan Cabral CauanCabral

View GitHub Profile
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, french_stem;
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english );
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, english_stem;
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german );
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING
@alganet
alganet / php_pratico_streams.md
Last active August 15, 2021 20:41
PHP Prático: Streams

PHP Prático: Streams

A palavra stream significa corrente. Em geral, qualquer conexão de rede é uma stream, e existem vários tipos de protocolos para streams. Esses protocolos definem como os dados fluem na corrente.

No PHP, vários protocolos são suportados de forma transparente:

<?php
@satooshi
satooshi / checkstyle.php
Last active November 27, 2018 02:30
Parse checkstyle.xml generated by PHP_CodeSniffer (phpcs --report=checkstyle --report-file=checkstyle.xml src) and print violation messages. If you want to color messages at severity, get ColorCLI class (see https://gist.github.com/satooshi/4750401).
<?php
function run($path)
{
$xml = simplexml_load_file($path);
foreach ($xml->file as $file) {
echo sprintf("file: %s", $file['name']) . PHP_EOL;
foreach ($file->error as $violation) {
echo " " . printMessage($violation) . PHP_EOL;