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 / 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 / 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 ./
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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()
@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 / {
@mebaysan
mebaysan / create_mssql_server_map.py
Last active March 22, 2022 10:04
Python Script to Create Database Map of MsSQL Server
!pip install pymssql
!pip install pandas
!pip install numpy
import pandas as pd
import numpy as np
import pymssql
def create_server_map(CONN):
# create base connection to get all databases on server
@mebaysan
mebaysan / start-sqlpad.sh
Last active June 20, 2022 11:36
A script file to start SQLPad on local machine by using Docker
#! /bin/bash
sudo docker run \
-v /home/mebaysan/Desktop/NorthwindDB.sqlite:/databases/NorthwindDB.sqlite \
--net=host \
--env SQLPAD_PORT=8000 \
--env SQLPAD_USERPASS_AUTH_DISABLED="false" \
--env SQLPAD_ADMIN="[email protected]" \
--env SQLPAD_ADMIN_PASSWORD="123." \
--env SQLPAD_CONNECTIONS__defaultcon__name="Nortwhind Conn" \
@mebaysan
mebaysan / projectName
Created February 14, 2022 11:34
An example Nginx conf file for a Django app
server {
listen 80;
server_name <DOMAIN> <AND / OR> <SERVER IP>;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/serverUsername/projectfolder/;
}
location /media/ {
@mebaysan
mebaysan / board_members.html
Created January 30, 2022 12:03
Yönetim kurulu şeması oluşturmak için hazır css dosyası
<div class="board-of-directors">
<h4>İhya Vakfı</h4>
<div class="bd-items">
<div class="first title">{{ baskan.isim }}</div>
<div class="items first">
{% for uye in baskan.uyeler.all %}
<div class="item">
<div class="image"><img src="{{ uye.resim.url }}" alt=""/></div>
<div class="content">
@mebaysan
mebaysan / actions.py
Last active December 4, 2022 09:04
Rasa Giriş
"""
ÖRNEK BİR CUSTOM ACTION
"""
from typing import Any, Text, Dict, List
from rasa_sdk import Action, Tracker
from rasa_sdk.executor import CollectingDispatcher
import requests