Skip to content

Instantly share code, notes, and snippets.

View BernardoSilva's full-sized avatar
🏠
Working from home

Bernardo Vieira da Silva BernardoSilva

🏠
Working from home
View GitHub Profile
@BernardoSilva
BernardoSilva / ohmyzsh.md
Created May 21, 2021 11:08 — forked from yovko/ohmyzsh.md
ZSH (using Oh My ZSH) on Manjaro Linux

ZSH (using Oh My ZSH) on Manjaro Linux

0. If ZSH is not already installed on your Manjaro system you can do it with the command:

sudo pacman -Syu zsh

You do not need to install manjaro-zsh-config and all the other related packages like zsh-syntax-highlighting, zsh-history-substring-search, zsh-autosuggestions, etc., as we will use Oh My Zsh.

https://www.kosinix.com/install-lets-encrypt-certificate-on-shared-hosting/
@BernardoSilva
BernardoSilva / server-debug-tips.txt
Created December 5, 2016 11:59
server-debug-tips
# Check the disk status of a server
$ df
# Find why the disk if full, list the 10 biggest directories/files from current directory
$ du -hsx * | sort -rh | head -10
@BernardoSilva
BernardoSilva / User.php
Created October 3, 2016 22:38 — forked from Ocramius/User.php
Doctrine 2 ManyToMany - the correct way
<?php
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* @ORM\Entity()
* @ORM\Table(name="user")
*/
class User
@BernardoSilva
BernardoSilva / mysql_mac_tips.txt
Created March 19, 2016 18:16
Mysql tips on Mac
// How to reset root password for MySQL on mac
mysql.server restart --skip-grant-tables
mysql
UPDATE mysql.user SET Password=PASSWORD('new_root_password') WHERE User='root';
exit
mysql -u root -p
// new_root_password or your password
@BernardoSilva
BernardoSilva / .editorconfig
Last active February 3, 2016 23:44
Javascript .editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
@BernardoSilva
BernardoSilva / install_git_autocomplete.sh
Created December 16, 2014 19:02
Install git autocomplete
#!/bin/bash
# Download the magic file.
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
# Add to ~/.bash_profile file the following 'execute if it exists' code:
cat <<EOT >> ~/.bash_profile
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
@BernardoSilva
BernardoSilva / install_mcrypt.sh
Last active August 29, 2015 14:10 — forked from phillpafford/install_mcrypt.sh
Compile and install mcrypt.so PHP extension for Mac OS X Mountain Lion, Yosemite
#!/usr/bin/sh
# NOTE: To execute this script: bash install_mcrypt.sh
# Pre Reqs, These are important!!!
# Install xCode
# Launch xCode and open Preferences
# Select the Downloads Tab in the Preference Panel
# Under Components install Command Line Tools
@BernardoSilva
BernardoSilva / optimize_git.sh
Last active May 2, 2020 18:34
Optimize your git performance on MAC OS X tips
# Highlight hash commit.
git config --global color.ui true
# Set opendiff as predefined tool to open while merging.
git config --global merge.tool opendiff
# Set alias for `git status` to `git st`.
git config --global alias.st status
# Shorter git status messages.
git config --global alias.s "status -s"
git config --global alias.co checkout
git config --global alias.br branch
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh