Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View woliveiras's full-sized avatar
🤖
Always typing code

William Oliveira woliveiras

🤖
Always typing code
View GitHub Profile
@woliveiras
woliveiras / charset-utf-8
Created November 5, 2014 22:12
Charset UTF-8 PHP/MySQL/Apache
php.ini contents
default_charset = "utf-8"
my.cnf contents
[client]
default-character-set=utf8
[mysqld]
character-set-server=utf8
default-character-set=utf8
File location: /etc/apache2/httpd.conf
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
File location: /etc/apache2/extra/httpd-userdir.conf
# Settings for user home directories
#
# Required module: mod_authz_core, mod_authz_host, mod_userdir
#
# UserDir: The name of the directory that is appended onto a user's home
# directory if a ~user request is received. Note that you must also set
# the default access control for these directories, as in the example below.
File location: /etc/apache2/extra/httpd-vhosts.conf
# Virtual Hosts
#
# Required modules: mod_log_config
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
File location: /etc/apache2/users
<Directory "/Users/williamsouza/Sites/">
Options Indexes MultiViews FollowSymLinks
Require all granted
AllowOverride All
Order allow,deny
Allow from all
</Directory>

Caso o MySQL não de acesso para o localhost ou apresente o erro: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/mysql/mysql.sock' (38)

Execute os comandos:

sudo mkdir /var/mysql

sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock

@woliveiras
woliveiras / gist:dad26e95f7387b4845f8
Created January 15, 2016 15:43 — forked from viniciusteles/gist:556029
Sete Atitudes para Hackear a Indústria de Software
Sete Atitudes para Hackear a Indústria de Software
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
for(var i = 0; i <= 5; i++) {
console.log(i);
};
console.log(i); // 6
for(let i = 0; i <= 5; i++) {
console.log(i);
};
console.log(i); // Uncaught ReferenceError: i is not defined
const myConst = "My const. This value cannot be changed";
myConst = "Trying change the value of a const" // Uncaught TypeError: Assignment to constant variable