Skip to content

Instantly share code, notes, and snippets.

View flaviosdev's full-sized avatar
🤓
Studying... Always!

Flavio Souza dos santos flaviosdev

🤓
Studying... Always!
View GitHub Profile
@MilesChou
MilesChou / adapter.php
Last active January 29, 2021 14:31
Adapter function example for mysql to mysqli
<?php
if (!function_exists('mysql_connect')) {
function mysql_connect($host, $username, $password) {
mysqli_connect($host, $username, $password);
}
}
mysql_connect('127.0.0.1', 'root', 'password');
@danielalvarenga
danielalvarenga / terminal-colors-branch.sh
Last active July 21, 2025 04:53
Show branch in terminal Ubuntu
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"
@asika32764
asika32764 / phpos-possible-values.md
Created August 16, 2014 06:18
PHP_OS possible values

Some possible values for PHP predefined constant PHP_OS:

  • CYGWIN_NT-5.1
  • Darwin
  • FreeBSD
  • HP-UX
  • IRIX64
  • Linux
  • NetBSD
  • OpenBSD