Skip to content

Instantly share code, notes, and snippets.

View CauanCabral's full-sized avatar

Cauan Cabral CauanCabral

View GitHub Profile
@CauanCabral
CauanCabral / .editorconfig
Last active April 7, 2022 18:40
Default EditorConfig setup for Node.js projects
root = true
[*]
charset = utf-8
end_of_line = lf
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
quote_type = single
@CauanCabral
CauanCabral / build.sh
Created January 26, 2022 12:49
Compiling PgModeler 0.9.4 with Ubuntu 21.04
#!/bin/bash
# First, download, extract and join the resource path
wget https://github.com/pgmodeler/pgmodeler/archive/refs/tags/v0.9.4.tar.gz -O pgmodeler-0.9.4.tar.gz
tar -zxvf pgmodeler-0.9.4.tar.gz
cd pgmodeler-0.9.4
# Get the plugins project using git
git clone https://github.com/pgmodeler/plugins.git
@CauanCabral
CauanCabral / pt_br.affix
Created November 24, 2020 21:03
Dicionários Hunspell PT-BR preparados para busca textual (FTS) com Postgresql. Fonte: https://cgit.freedesktop.org/libreoffice/dictionaries/tree/pt_BR
This file has been truncated, but you can view the full file.
SET UTF-8
TRY áàãâéêíóõôúüçesianrtolcdugmphbyfvkwjqxz
# VERO - Verificador Ortográfico Livre - Versão 3.2
# Copyright (C) 2006 - 2013 por Raimundo Santos Moura
# <raimundo.smoura@gmail.com>
# Brasil - outubro 2013
# Este é um dicionário para correção ortográfica da língua Portuguesa
# para o Hunspell.
# Este programa é livre e pode ser redistribuído e/ou modificado nos
@CauanCabral
CauanCabral / AppController.php
Last active July 3, 2020 16:11
CakePHP 4.1 Application Sample with Authentication and Authorization middlewares
<?php
namespace App\Controller;
class AppController extends Controller
{
/**
* Initialization hook method.
*
* Use this method to add common initialization code like loading components.
*
@CauanCabral
CauanCabral / .gitignore
Created June 24, 2016 18:32
Global .gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
*.class
*.pyo
@CauanCabral
CauanCabral / TsvectorType.php
Created February 22, 2015 15:54
CakePHP 3.0 - Textual search support in Postgresql
<?php
namespace App\Database\Type;
use Cake\Database\Driver;
use Cake\Database\Type;
use PDO;
class TsvectorType extends Type
{
@CauanCabral
CauanCabral / Cake\ORM\Table->_insert(App\Model\Entity\Article, array)
Created November 14, 2014 19:02
CakePHP 3 Problem with localized date
object(App\Model\Entity\Article) {
'new' => true,
'accessible' => [
[maximum depth reached]
],
'properties' => [
[maximum depth reached]
],
'dirty' => [
@CauanCabral
CauanCabral / install_gearman.sh
Created July 15, 2014 21:09
Install Gearman latest stable ( 1.0.6 ) in OpenSUSE latest stable ( 13.1 )
#!/bin/bash
# Run this script as root
# ADD REPOSITORY
zypper ar -f http://download.opensuse.org/repositories/server:/monitoring/openSUSE_13.1/ Monitoring
zypper refresh
# INSTALL ALL RELATED PACKAGES
zypper in gearmand-server gearmand-server-mysql gearmand-server-postgresql gearmand-server-sqlite3 gearmand-tools gearmand-devel
@CauanCabral
CauanCabral / mydoc.php
Last active January 3, 2022 14:25
PHPWord ToC
<?php
require('Vendor/autoload.php');
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$phpWord->setDefaultFontName('Calibri');
$phpWord->setDefaultFontSize(14);
$phpWord->addFontStyle('normal', array(
'color' => '000000',
'bold' => false,
@CauanCabral
CauanCabral / MyStat.php
Last active August 29, 2015 13:59
Pequeno teste para checar o compartilhamento de informação estática entre processos/requisições
<?php
class MyStat {
protected static $_data = ['initial' => 'default'];
public static function set($key, $value) {
self::$_data[$key] = $value;
}
public static function get($key) {
if (isset(self::$_data[$key])) {