Skip to content

Instantly share code, notes, and snippets.

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

Baysan mebaysan

🏠
Working from home
View GitHub Profile
@mebaysan
mebaysan / README.md
Last active January 6, 2024 08:22
Django Custom User Event Logging

Custom Event Logging

The Custom Event Logging system is designed to bolster observability, accountability, and security within your application. It offers a structured approach to log diverse user activities and system events. By leveraging this logging mechanism, you can systematically track and monitor user interactions, system operations, and security-related events in the database.

This system comprises models like EventLog and UserLog, alongside essential helper functions such as log_user. These components collectively enable the creation of detailed logs tailored to different system functionalities. The approach utilizes Django's robust framework to categorize and store logs efficiently, enhancing the application's visibility and traceability.

image

Models

@mebaysan
mebaysan / ajax_method_caller.py
Last active January 6, 2024 07:54
Django Ajax Method Caller for Stunning Ajax Calls
# Medium article: https://medium.com/codex/django-ajax-calls-stunning-crafty-method-abaf6b828023
# helpers/dynamic_importer.py
import importlib
class DynamicImporter:
def import_module(self, module_name):
return importlib.import_module(module_name)
@mebaysan
mebaysan / README.md
Created October 3, 2022 06:42
Django View Customization

Django admin sayfalarının görünümlerini döndürürken öncelikle settings.py içerisinde set ettiğimiz templates klasörüne gider ve buradaki admin klasörünün altına bakar. Eğer bu yolu (path) bulamazsa (admin klasörü eklememişsek) default olarak kendi görünümlerini döndürür.

Django ile birlikte gelen admin sayfasının formları default olarak şu yapıdadır. Modellerimize özel form sayfalarını özelleştirirken bu sayfaları extend edeceğiz.

  • Liste Sayfası -> admin/change_list.html
  • Ekleme ve Güncelleme Sayfaları -> admin/change_form.html
  • Silme İşlemi İçin Onay Sayfası -> admin/delete_confirmation.html
@mebaysan
mebaysan / action.yml
Created August 18, 2022 07:32
GitHub Action File to Deploy Files via FTP
# This is a basic workflow to help you get started with Actions
name: Kodları push edildiğinde sunucuya aktar.
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
pull_request:
branches: [ master ]
@mebaysan
mebaysan / aliases.sh
Last active November 19, 2022 20:25
My Git Aliases for Bash
# My aliases
alias gs='git status -sb'
alias gaa='git add --all'
alias gc='git commit -m $2'
alias gp='git push'
alias gpo='git push origin'
alias gpl='git pull'
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias ga='git add $2'
alias gb='git branch'
@mebaysan
mebaysan / docker-compose.yml
Last active September 8, 2022 17:25
PgAdmin & Postgres
version: "3.9"
services:
db:
image: postgres
container_name: dwh-db
restart: unless-stopped
ports:
- "5432:5432"
@mebaysan
mebaysan / site
Last active April 12, 2022 14:01
An Nginx conf file to put in /etc/nginx/sites-available . We can bind a domain into a Docker container
server {
listen 80;
listen [::]:80;
server_name videomeet.app;
server_name_in_redirect off;
access_log /var/log/nginx/reverse-access.log;
error_log /var/log/nginx/reverse-error.log;
location / {
@jrbergen
jrbergen / proton_compat_coh2_syncerror.md
Last active July 21, 2024 13:21
Instructions to resolve Company Of Heroes 2 Sync-Error for Proton (Tested on 5.0-10)

Instructions to resolve Company Of Heroes 2 Sync-Error for Proton (Tested on 5.0-10 and 6.3-2)

In support of this comment on Proton's CoH2 issues thread: Company of Heroes 2 (231430) #3875

Based on original solution by @Cytomax55 in the same thread.

Edit Feb 2023: this may also work for CoH3 (the paths are different of course). I haven't tested this for CoH 3 yet and hope either Proton / Relic will make this fix unnecessary. See also @sfxworks's comment.

Instructions for automatic fix with a script by TechT10n

@manishtiwari25
manishtiwari25 / country_state.json
Last active July 1, 2024 00:07
List Of Countries With States And Other Useful Information, Updated On 07/01/2024 00:07:57
[
{
"name": "Andorra",
"countryCode": "AD",
"countryCodeAlpha3": "AND",
"phone": "376",
"currency": "EUR",
"flag": "",
"symbol": "\u20AC",
"stateProvinces": [
@LucasCalazans
LucasCalazans / fix.md
Created April 17, 2020 13:44
Fedora - Fix screen share Google Meet

To fix the error when trying to share the whole screen in the Google Meet/Hangouts you need to edit this file

sudo vi /etc/gdm/custom.conf

un-commenting this line WaylandEnable=false