Skip to content

Instantly share code, notes, and snippets.

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

Taghwo Millionaire taghwo

🏠
Working from home
View GitHub Profile
@taghwo
taghwo / default nginx configuration file
Created April 27, 2019 15:18 — forked from skbr1234/default nginx configuration file
The default nginx configuration file inside /etc/nginx/sites-available/default
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
@taghwo
taghwo / AppServiceProvider.php
Created October 5, 2019 21:13 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@taghwo
taghwo / vscode_shortcuts.md
Created November 1, 2019 18:25 — forked from bradtraversy/vscode_shortcuts.md
Helpful shortcuts for VSCode

VSCode Shortcuts

List of helpful shortcuts for faster coding

Official List of all commands

Open/View

@taghwo
taghwo / certbot nginx
Last active October 28, 2020 13:45
commands to add certbot to nginx
nginxssl
sudo add-apt-repository ppa:certbot/certbot
or
sudo apt-add-repository -r ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
or
@taghwo
taghwo / nginx optmization
Created July 16, 2020 07:55
nginx optimization config
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/atom+xml
application/javascript
application/json
@taghwo
taghwo / digital ocean laravel
Last active August 6, 2021 13:00
A comprehensive breakdown of command to set up Laravel on digital ocean. Has commands for Nginx,Mysql,Supervisor and canonical URLS. Open to PR
#vim commands you will need
vim shortcuts
<ESC> :wq :exit to save and close;
i to insert
<ESC>GA to move to bottom of file
#Set pc sshkeygen for droplet ssh
@taghwo
taghwo / Laravel nginx config
Created July 16, 2020 08:40
Laravel default nginx config
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# http://wiki.nginx.org/Pitfalls
# http://wiki.nginx.org/QuickStart
# http://wiki.nginx.org/Configuration
#
# Generally, you will want to move this file somewhere, and start with a clean
# file but keep this around for reference. Or just disable in sites-enabled.
#
Error
ArithmeticError
DivisionByZeroError
AssertionError
CompileError
ParseError
TypeError
ArgumentCountError
Exception
ClosedGeneratorException
@taghwo
taghwo / docker-help.md
Last active October 28, 2020 07:32 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info

@taghwo
taghwo / serializers.py
Created November 12, 2020 12:15 — forked from orehush/serializers.py
DRF simple JWT logout flow
from django.utils.text import gettext_lazy as _
from rest_framework import serializers
from rest_framework_simplejwt.tokens import RefreshToken, TokenError
class RefreshTokenSerializer(serializers.Serializer):
refresh = serializers.CharField()
default_error_messages = {
'bad_token': _('Token is invalid or expired')
}