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 / 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>
@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;
You can’t perform that action at this time.