Skip to content

Instantly share code, notes, and snippets.

☮️

Özcan Yarımdunya ozcanyarimdunya

☮️
Block or report user

Report or block ozcanyarimdunya

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ozcanyarimdunya
ozcanyarimdunya / admin.py
Last active Jun 13, 2019
Django Admin JsonEditor | `pip install django-jsoneditor`
View admin.py
from django.contrib import admin
from jsoneditor.forms import JSONEditor
from django.contrib.postgres.fields import JSONField
from demo.models import Demo
class DemoAdmin(admin.ModelAdmin):
formfield_overrides = {
JSONField: {'widget': JSONEditor},
View vue-spa.html
<!DOCTYPE html>
<html>
<head>
<title>Vue | SPA</title>
<script src="vue.min.js"></script>
<link rel="shortcut icon" href="/favicon.ico">
<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.min.js"></script> -->
</head>
<body>
<div>
@ozcanyarimdunya
ozcanyarimdunya / generic.py
Last active Mar 27, 2019
How to write class based generic python
View generic.py
"""
Animal
=======
+ name
+ legs
"""
class Animal(object):
name = None
@ozcanyarimdunya
ozcanyarimdunya / readme.md
Last active Mar 20, 2019
How to create mkdocs on your local with docker
View readme.md

File structure

project/
├── docs
│   ├── about.md
│   ├── assets
│   │   └── back.png
│   ├── index.md
│   └── installation.md
@ozcanyarimdunya
ozcanyarimdunya / website.conf
Created Mar 3, 2019
Docker-django-nginx conf
View website.conf
upstream web {
ip_hash;
server web:8000;
}
# portal
server {
listen 8000;
server_name localhost;
@ozcanyarimdunya
ozcanyarimdunya / main.py
Last active Feb 23, 2019
python logger snippet
View main.py
import logging
from models import Person
fmt = "[%(asctime)s]:%(levelname)s:line,%(lineno)d:%(module)s:%(funcName)s: %(message)s"
lvl = logging.DEBUG
logging.basicConfig(level=lvl, format=fmt)
logger = logging.getLogger()
logger.debug("Hello")
@ozcanyarimdunya
ozcanyarimdunya / MultiToSingleDict.py
Last active Jul 29, 2018
Multi nested key dictionary to single dictionary
View MultiToSingleDict.py
import pandas as pd
class MultiToSingleDict:
def __init__(self, data, sep='.'):
self._data = data
self._sep = sep
self._out = {}
View pipenv_conf.md

Pipenv Configurations

  1. To install pipenv
pip install pipenv
  1. if you want to use .venv under the your_project/.venv
export PIPENV_VENV_IN_PROJECT=1
@ozcanyarimdunya
ozcanyarimdunya / one.ui
Last active Sep 26, 2017
one more time
View one.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>666</width>
<height>444</height>
You can’t perform that action at this time.