Skip to content

Instantly share code, notes, and snippets.

View natanfelles's full-sized avatar
💥
Hunting bugs!

Natan Felles natanfelles

💥
Hunting bugs!
View GitHub Profile
@natanfelles
natanfelles / Install-xdebug-php7.1.md
Created January 11, 2018 20:59 — forked from asanikovich/Install-xdebug-php7.1.md
Installing xdebug for php7.1 on Ubuntu 14.04

Install xdebug extension

# Download stable release of xdebug from https://xdebug.org/download.php
wget -c "https://xdebug.org/files/xdebug-2.5.3.tgz"
# Extract archive
tar -xf xdebug-2.5.3.tgz

cd xdebug-2.5.3/
@natanfelles
natanfelles / theme_darcula.xml
Created June 13, 2016 14:48
gedit darcula theme
<?xml version="1.0" encoding="UTF-8"?>
<style-scheme id="darcula" _name="Darcula" version="1.0">
<author>Sash0k</author>
<_description>Dark color scheme using IntelliJ IDEA colors</_description>
<!-- Scribe Theme Generator 1.3 -->
<!-- COLORS -->
<color name="comment_color" value="#629755"/>
@natanfelles
natanfelles / domain.tld.conf
Last active May 12, 2024 03:51
Nginx Virtual Host example to work on localhost
# Location: /etc/nginx/sites-available/domain.tld.conf
server {
listen 80;
# listen 443 ssl;
# include snippets/snakeoil.conf;
root /var/www/domain.tld/public;
index index.html index.php;
@natanfelles
natanfelles / text_helper.php
Created February 20, 2020 23:12
HTML Purifier Helper for TinyMCE
<?php
/**
* @param string $content
*
* @return string
*/
function purify(string $content) : string
{
$config = \HTMLPurifier_Config::createDefault();
$config->set('HTML.AllowedElements', [
@natanfelles
natanfelles / atom-php.md
Last active January 25, 2024 03:48
Atom PHP Environment + CodeIgniter 3 & 4

Atom PHP Environment + CodeIgniter 3 & 4

Atom Editor

Install

Download and install Atom Editor:

cd ~/Downloads
@natanfelles
natanfelles / db_helper.php
Last active August 18, 2023 03:15
CodeIgniter Database Helper to Add and Drop Foreign Keys and Triggers
<?php
/**
* @author Natan Felles <natanfelles@gmail.com>
*/
defined('BASEPATH') OR exit('No direct script access allowed');
if ( ! function_exists('add_foreign_key'))
{
/**
* @param string $table Table name
@natanfelles
natanfelles / Access.php
Created December 14, 2016 19:51
CodeIgniter Strong Password Validation
<?php
/**
* @author Natan Felles <natanfelles@gmail.com>
*/
defined('BASEPATH') or exit('No direct script access allowed');
/**
* Class Access
*/
class Access extends CI_Controller {
@natanfelles
natanfelles / git_submodules.md
Created July 13, 2021 18:50 — forked from gitaarik/git_submodules.md
Git Submodules basic explanation

Git Submodules basic explanation

Why submodules?

In Git you can add a submodule to a repository. This is basically a repository embedded in your main repository. This can be very useful. A couple of advantages of using submodules:

  • You can separate the code into different repositories.
@natanfelles
natanfelles / codeigniter4-bootstrap-pager.php
Created April 15, 2020 20:30
CodeIgniter 4 Bootstrap Pager
<?php
/**
* @var \CodeIgniter\Pager\PagerRenderer $pager
*/
$pager->setSurroundCount(2);
?>
<nav aria-label="<?= lang('Pager.pageNavigation') ?>">
<ul class="pagination">
$ sudo apt update
Obter:1 http://deb.debian.org/debian buster InRelease [122 kB]
Err:1 http://deb.debian.org/debian buster InRelease
As assinaturas a seguir não puderam ser verificadas devido à chave pública não estar disponível: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
Lendo listas de pacotes... Pronto
W: Erro GPG: http://deb.debian.org/debian buster InRelease: As assinaturas a seguir não puderam ser verificadas devido à chave pública não estar disponível: NO_PUBKEY 04EE7237B7D453EC NO_PUBKEY 648ACFD622F3D138 NO_PUBKEY DCC9EFBF77E11517
E: The repository 'http://deb.debian.org/debian buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.