Skip to content

Instantly share code, notes, and snippets.

View guiliredu's full-sized avatar
🚀
Working

Guilherme Dias Redü guiliredu

🚀
Working
View GitHub Profile
@guiliredu
guiliredu / 0-Snippets.md
Last active March 12, 2020 18:08
Docker - Basic Commands / Cheatsheet

Docker Snippets

MongoDB

  • Running: docker run -d -p 27017-27019:27017-27019 --name mongodb mongo:4.0.4
  • Bash: docker exec -it mongodb bash

MySQL

  • Running: docker run -d -e MYSQL_ALLOW_EMPTY_PASSWORD=true -p 3306:3306 -v ~/Projects/Docker/mysql:/var/lib/mysql --name mysql mysql:5.7
@guiliredu
guiliredu / PHPDocExample.php
Last active August 23, 2018 17:25
Example of a PHP Class with Doc Block annotation
<?php
/**
* This class acts as an example on where to position a DocBlock.
*
* A blank line must be place after each paragraph. A title and a description
* can be add. Multiple paragraph descriptions can be used.
*
* @see https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md
* @see http://docs.phpdoc.org/guides/docblocks.html#list-of-tags
@guiliredu
guiliredu / #ServerConfigLemp.md
Last active February 19, 2019 14:27
Server Management Annotations

Server configuration - Basics and LEMP

Installation - Server basics

  • sudo add-apt-repository -y ppa:nginx/development - repository for latest nginx
  • sudo add-apt-repository -y ppa:ondrej/php - repository for latest php
  • sudo add-apt-repository -y ppa:chris-lea/redis-server - for latest redis
  • sudo apt-get update to update the server packages
  • sudo apt-get install -y git tmux vim curl wget zip unzip htop - basic commands and softwares
@guiliredu
guiliredu / headers.php
Created May 21, 2018 20:03 — forked from irazasyed/headers.php
PHP HTTP Headers (Examples)
<?php
# Source: http://www.jonasjohn.de/snippets/php/headers.htm
// Use this header instruction to fix 404 headers
// produced by url rewriting...
header('HTTP/1.1 200 OK');
// Page was not found:
header('HTTP/1.1 404 Not Found');
@guiliredu
guiliredu / zsh-on-windows.md
Created May 16, 2018 22:03 — forked from aviaryan/zsh-on-windows.md
Installing zsh and oh-my-zsh on Windows
  1. Install zsh from cygwin
  2. Install oh-my-zsh from https://github.com/robbyrussell/oh-my-zsh . Follow the manual instructions
  3. To make zsh default on ConEmu, create a task with C:\cygwin64\bin\mintty.exe /usr/bin/zsh - . Make it the defaut shell.
  4. To start a zsh shell on demand, add this batch script to your path or start menu or wherever.
start C:\cygwin64\bin\mintty.exe /usr/bin/zsh -
@guiliredu
guiliredu / Sublime-Configuration.md
Last active May 29, 2019 23:21
Sublime Configuration

Sublime Configuration

Packages

  • Fileicons
  • Laravel Blade Highlighter
  • Vue Syntax Highlight
  • Sass
  • Emmet
  • Emmet CSS Snippets
@guiliredu
guiliredu / deploy.sh
Last active August 27, 2018 12:02
Laravel - Deploy scripts
echo '-- Shutdown the laravel app'
php artisan down
echo '-- Pulling from git'
git pull
echo '-- Storage permissions'
#find storage -type f -exec chmod 664 {} \;
#find storage -type d -exec chmod 775 {} \;
@guiliredu
guiliredu / README.md
Created November 23, 2017 13:23
PSR-2 Build System using Sublime Text

PSR-2 Build System using Sublime Text

Installation

Open a new terminal and install Composer:

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

Once that has finished installing and moved, install the PHP-CS-Fixer Composer package globally:

@guiliredu
guiliredu / php-storm-tips.md
Last active November 20, 2017 17:28 — forked from kurorido/gist:d8197e49434bf53e37cb
PHP Storm Tips

PHP Storm - Tips

Shortcuts

  • Ctrl+Alt+V (Refactor | Extract Variable)
  • Ctrl+D in the editor duplicates the selected block or the current line when no block is selected.
  • If the cursor is between the parentheses of a method call, pressing Ctrl+P brings up a list of valid parameters.
  • Ctrl+Shift+Backspace (Navigate | Last Edit Location)
  • Use Ctrl+Shift+F7 (Edit | Find | Highlight Usages in File) to quickly highlight usages of some variable in the current file.
  • Use F3 and Shift+F3 keys to navigate through highlighted usages.
@guiliredu
guiliredu / fb-login.html
Last active October 4, 2017 22:12
Facebook Login with Javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Facebook Login with Javascript</title>
</head>
<body>
<div id="fb-root"></div>
<script>