Skip to content

Instantly share code, notes, and snippets.

View lightglitch's full-sized avatar

Mário Franco lightglitch

View GitHub Profile
@lightglitch
lightglitch / pg_search_conf_unaccented.sql
Created December 6, 2022 18:34 — forked from YourFriendCaspian/pg_search_conf_unaccented.sql
PostgreSQL - full-text search configuration
-- enable extensions
-- full-text search on postgresql
CREATE EXTENSION unaccent;
-- languages supported
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 );
@lightglitch
lightglitch / s3_example.php
Created November 10, 2022 21:44 — forked from charlie-s/s3_example.php
S3 PHP Example (without an SDK)
<?php
class S3 {
private $key = 'ABC123';
private $secret = 'lolftw';
private $region = 'us-west-2';
private $bucket = 'examplebucket';
private $host = 's3.amazonaws.com';
@lightglitch
lightglitch / s3SimpleUpload.php
Created November 10, 2022 21:44 — forked from humbletiger/s3SimpleUpload.php
s3SimpleUpload.php is a standalone (no AWS SDK), intentionally verbose, upload only S3 class utilizing the AWS API, Signature Version 4.
<?php
/*
ABSTRACT
s3SimpleUpload.php is a standalone (no AWS SDK), intentionally verbose, upload only S3 class utilizing the AWS API, Signature Version 4.
Options include defining the s3_prefix path, regardless of the origination path, or using the source file's origination prefix path (default).
USAGE
@lightglitch
lightglitch / Request.php
Created October 11, 2017 17:13 — forked from johnkary/Request.php
Example of how to request raw XML via a SoapClient
<?php
use Psr\Log\LoggerInterface;
/**
* Assembles and dispatches the SOAP request body XML and returns the
* Response body XML from the vendor API.
*/
class Request
{