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 / storage.js
Created Dec 16, 2019
A simple database approach to browser local storage
View storage.js
/**
* A database controller for browser's localStorage
*
* @author: ozcanyarimdunya
* @date: 16.12.2019
* @version: 1.0.0
*
* Example
* ~~~~~~~~~~~~~~~~~~~~~~~~
*
View python_kafka_docker.md

Python kafka test with docker

Check the link for more.

Installation

$ git clone https://github.com/wurstmeister/kafka-docker.git 
$ cd kafka-docker

# Update KAFKA_ADVERTISED_HOST_NAME inside 'docker-compose.yml',
@ozcanyarimdunya
ozcanyarimdunya / class_decorator.py
Created Nov 19, 2019
class and method decorators
View class_decorator.py
def url(path):
class New:
def __init__(self, klass):
klass(path, name='ozcan')
klass.as_view()
return New
@url(path='/')
@ozcanyarimdunya
ozcanyarimdunya / README.md
Last active Nov 4, 2019
Cpu monitor with pystray
View README.md

Installation

Install following requirements in global python3 environment, otherwise it will not work

pip install pystray psutil

Running

@ozcanyarimdunya
ozcanyarimdunya / updater.py
Last active Oct 31, 2019
Python app updater/downloader
View updater.py
import os
import requests
class Updater:
"""
Application updater
>>> updater = Updater(version='1.0.0')
@ozcanyarimdunya
ozcanyarimdunya / _1_service.js
Last active Jul 26, 2019
JavaScript callback example
View _1_service.js
const service = module.exports = {};
service.initialise = function(todoList) {
this.todoList = todoList;
}
service.get = function(id, callback) {
const _todo = this.todoList.find(todo => todo.id == id);
if (callback) {
View app.py
import sys
from PyQt5 import uic
from PyQt5.QtWidgets import QWidget, QApplication
class MainForm(QWidget):
def __init__(self, flags=None, *args, **kwargs):
super().__init__(flags, *args, **kwargs)
@ozcanyarimdunya
ozcanyarimdunya / change_dict_key_of_list.py
Last active Jul 21, 2019
Change the key of an dictionary in the list
View change_dict_key_of_list.py
data = [
{
'data': '21.07.2019 12:20',
'title': 'Sample title 1',
},
{
'data': '21.07.2019 11:00',
'title': 'Sample data 2',
},
]
@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>
You can’t perform that action at this time.