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 December 3, 2024 11:28
DevOps-101 | Gerçek Bir CI & CD Pipeline: Docker - Jenkins - GitHub Actions - Nginx
@mebaysan
mebaysan / plotly-bar-rounded-edge-chart.js
Created October 15, 2022 16:03
A function to generate rounded-edge bar charts in Plotly
var hr_bar_data = {{hr_bar_data|safe}}; // Django template language syntax
var bar_trace = {
x: [],
y: [],
name: 'HR Bar',
orientation: 'h',
marker: {
color: '#5058B8',
width: 1
@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 / debug.php
Created September 8, 2022 07:27
PHP debug to console...
function debug_to_console($data) {
$output = $data;
if (is_array($output))
$output = implode(',', $output);
echo "<script>console.log('Debug Objects: " . $output . "' );</script>";
}
@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 / base.html
Created June 18, 2022 12:04
Toast js Django messages
{% if messages %}
{% for message in messages %}
<script>
new Toast({
message: '{{ message }}',
type: '{{ message.tags }}'
});
</script>
{% endfor %}
@mebaysan
mebaysan / Makefile
Last active June 16, 2022 17:14
A sample Makefile for Django projects
.PHONY: help
help:
@echo "{{ project_name }} Projects"
@echo "~~~~~~~~~~~~~~~"
@echo ""
@echo "check : Health check"
@echo "coverage : Make test coverage"
@echo "docup : Run docker compose services"
@echo "docdown : Stop docker containers"
@mebaysan
mebaysan / pip.sh
Created June 9, 2022 07:17
Upgrade the all packages by using pip
pip list -o --format columns| cut -d' ' -f1|xargs -n1 pip install -U