Skip to content

Instantly share code, notes, and snippets.

View InFog's full-sized avatar
🤔
Thinking

Evaldo Bento InFog

🤔
Thinking
View GitHub Profile
PROMPT='%{$FG[255]%}%{$BG[068]%} %n@%m %{$reset_color%}%{$FG[255]%}%{$BG[025]%} %/ %{$reset_color%}$(git_prompt_info)
%(!.#.$) '
RPROMPT='%{$FG[255]%}%{$BG[068]%} %D{%H:%M:%S} %{$reset_color%}'
ZSH_THEME_GIT_PROMPT_PREFIX="%{$FG[255]%}%{$BG[071]%} "
ZSH_THEME_GIT_PROMPT_SUFFIX=" %{$reset_color%}"
@InFog
InFog / comfyline.sh
Created August 14, 2023 18:57
My colors for comfyline
RETVAL_b="#005f87" # background
RETVAL_f="#eceeed" # foreground
HOST_b="#5f87af"
HOST_f="#eceeed"
USER_b="#005f87"
USER_f="#eceeed"
GIT_b="#f6b3b3"
GIT_f="#d95353"
GIT_CLEAN_b="#b3f58c"
GIT_CLEAN_f="#568459"
@InFog
InFog / burp.md
Created March 13, 2012 12:31
How to code drunk

How to code drunk

Some people born with it, some people are self-taught on this, some people just discover how. How about a guide on how to code great software while still drunk as a cow?

Rules

  • You can add your patterns by forking this gist.
  • You must be drunk before sending a pattern.
@InFog
InFog / tarefas.css
Created October 7, 2013 00:37
CSS usado nos exemplos do sistema de tarefas do livro PHP e MySQL da Casa do Código http://www.casadocodigo.com.br/products/livro-php-mysql
body {
font-family: Sans-serif;
color: #333;
}
h1 {
text-align: center;
}
.erro {
# Get openssl-1.1.1 tar gz
wget https://github.com/openssl/openssl/releases/download/OpenSSL_1_1_1t/openssl-1.1.1t.tar.gz
./config shared enable-ec_nistp_64_gcc_128 -Wl,-rpath=/usr/local/openssl/lib --prefix=/usr/local/openssl
make -j 4
make test && sudo make install
# Then finally install PHP 7
cd /usr/local/openssl
export PHP_OPENSSL_DIR=yes
@InFog
InFog / proceduralphp.md
Last active March 23, 2023 08:15
PHP Procedural Framework Manifesto

Procedural PHP Manifesto

We are web site developers (a.k.a. webmasters) and we just want to get stuff done. We don't need Object Orientation and we don't need Design Patters and other boring and not easy to learn and understand stuff to get in our way to get our sites up and running.

And that's why our values are:

  1. Procedural Code over Object Orientation
  • No one actually needs OO to develop web applications
  • Classes with only static functions are ok, since it's just a way to keep functions in one place. And is still procedural
  1. Explicitly load what you need over autoloaders
@InFog
InFog / Torne-se Excelente
Created August 30, 2010 01:03 — forked from viniciusteles/gist:556029
Torne-se Excelente
By Klaus Wuestefeld
1) Torne-se excelente.
Seja realmente bom em alguma coisa. Não fique só choramingando ou
querendo progredir às custas dos outros. Não pense q pq vc sentou 4
anos numa faculdade ouvindo um professor falar sobre software q vc
sabe alguma coisa. Jogador de futebol não aprende a jogar bola tendo
aula. Ele pratica. Instrumentistas geniais nao aprendem a tocar tendo
aula. Eles praticam. Pratique. Chegue em casa depois do trabalho e da
@InFog
InFog / Livros.md
Last active October 18, 2019 14:45
Livros para vender/doar

Programação / Dev

  • [Doado] jQuery A Biblioteca do Programador JavaScript | Maurício Samy Silva | Novatec
  • [Doado] CodeIgniter Framework PHP | Ademir Cristiano Gabardo | Novatec
  • [Doado] Python e Django Desenvolvimento Ágil de Aplicações Web | Osvaldo Santana e Thiago Galesi | Novatec
  • [Doado] Shell Script Profissional | Aurélio Marinho Jargas | Novatec
  • [Doado] O Melhor do JavaScript | Douglas Crockford | Alta Books
  • [Doado] Padrões JavaScript | Stoyan Stefanov | Novatec
  • [Doado] O Melhor do PHP | Peter B. MacIntyre | Alta Books
  • [Doado] Autenticação Centralizada com OpenLDAP | Marcos Sungaila | Novatec
<?php
include __DIR__ . "/vendor/autoload.php";
use Elastica\Client;
use Monolog\Formatter\LogstashFormatter;
use Monolog\Handler\ElasticSearchHandler;
use Monolog\Logger;
$logger = new Logger("MyApp");
@InFog
InFog / filter_email.php
Created January 15, 2018 14:49
Filter email in PHP
<?php
$validInput = "email@mail.com";
$invalidInput = "\"'/><script>alert(1)</script>";
echo "Valid: ";
echo filter_var($validInput, FILTER_VALIDATE_EMAIL);
echo PHP_EOL;
echo "Invalid: ";