Skip to content

Instantly share code, notes, and snippets.

View gemarkalmacen's full-sized avatar
🎯
Focusing

Gemark M. Almacen gemarkalmacen

🎯
Focusing
View GitHub Profile
@gemarkalmacen
gemarkalmacen / rename_app.py
Created March 4, 2024 10:02 — forked from rafaponieman/rename_app.py
Django rename app management command
import argparse
from django.core.management.base import BaseCommand
from django.db import connection
class Command(BaseCommand):
help = 'Renames app. Usage rename_app [old_name] [new_name] [classes ...]'
def add_arguments(self, parser):
Here is a quick way to add authentication logging to Laravel.
1. Modify app/Providers/EventServiceProvider.php and add lines 16 through 32 of the example file in this GIST.
2. Create a new file app/Listeners/LogActivity.php and copy the contents of the file below into that file.
3. Enjoy logging.
@gemarkalmacen
gemarkalmacen / gist:991658cbd6f7eccd5d7f336245c0bdf4
Last active September 16, 2021 08:43
NPM Error when listening on most ports - npm run dev error
NPM Error when listening on most ports - npm run dev error
run cmd as administrator and run this command
net stop winnat
net start winnat
@gemarkalmacen
gemarkalmacen / Response.php
Created April 29, 2021 14:19 — forked from jeffochoa/Response.php
Laravel HTTP status code
<?php
// This can be found in the Symfony\Component\HttpFoundation\Response class
const HTTP_CONTINUE = 100;
const HTTP_SWITCHING_PROTOCOLS = 101;
const HTTP_PROCESSING = 102; // RFC2518
const HTTP_OK = 200;
const HTTP_CREATED = 201;
const HTTP_ACCEPTED = 202;
DB::enableQueryLog();
-- Laravel Query here
DB::getQueryLog();