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 / choropleth_mapbox-scattermapbox-binded.py
Created March 31, 2022 11:28
We can add dots on a choropleth map
import json
import requests
import plotly.express as px
import plotly.graph_objects as go
geojson = requests.get(
"https://gist.githubusercontent.com/mebaysan/9be56dd1ca5659c0ff7ea5e2b5cf6479/raw/6d7a77d8a2892bd59f401eb87bd82d7f48642a58/turkey-geojson.json"
).json()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mebaysan
mebaysan / create.sh
Created April 30, 2022 15:27
Example script files to use node without installing on local: Creating a react app & running the app
#! /bin/bash
docker run --rm -it -v "$PWD"/app:/app -w /app node:16 npx create-react-app ./
@mebaysan
mebaysan / script.py
Created May 16, 2022 08:09
Python decorator example
class Person:
def __init__(self,name,age):
self.name = name
self.age = age
def check_age(func):
def wrapper(person,*args,**kwargs):
if person.age < 18:
print(f'You can not enter the party {person.name} because you are younger than 18!')
@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
@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 / 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 / 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 / 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 / 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 ]