Skip to content

Instantly share code, notes, and snippets.

View ozcanyarimdunya's full-sized avatar
🌍

ÖZCAN YARIMDÜNYA ozcanyarimdunya

🌍
View GitHub Profile
@ozcanyarimdunya
ozcanyarimdunya / data.py
Last active June 29, 2017 08:58
Connect Postgres with asyncpg | Python
import asyncio
import asyncpg
class Data:
def __init__(self, query):
self.query = query
async def connect(self):
@ozcanyarimdunya
ozcanyarimdunya / form.py
Last active June 29, 2017 11:12
Simple Form Application in PyQt5 | Python
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'designer\form.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
@ozcanyarimdunya
ozcanyarimdunya / .bash_alias
Last active June 30, 2017 11:26
Expect | Bash Scripting
alias changedns='expect /home/l50/Application/expect/change_dns && exit'
import paramiko
from paramiko_expect import SSHClientInteraction
class Connection:
def __init__(self):
self.client = paramiko.SSHClient()
self.client.load_system_host_keys()
self.client.set_missing_host_key_policy(paramiko.AutoAddPolicy)
self.client.connect(hostname='192.168.1.24', username='ozcan', password='ozcan')
@ozcanyarimdunya
ozcanyarimdunya / sample_wsgi.py
Created July 16, 2017 10:26
pythonanywhere sample wsgi
import os
import sys
path = '/home/pythonanywhereusername/projectname' # use your own PythonAnywhere username here
if path not in sys.path:
sys.path.append(path)
os.environ['DJANGO_SETTINGS_MODULE'] = 'projectname.settings'
@ozcanyarimdunya
ozcanyarimdunya / form.py
Last active August 10, 2017 08:38
Calculator
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui_xml\calc.ui'
#
# Created by: PyQt5 UI code generator 5.8.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
@ozcanyarimdunya
ozcanyarimdunya / one.ui
Last active September 26, 2017 20:13
one more time
<?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>
@ozcanyarimdunya
ozcanyarimdunya / pipenv_conf.md
Created May 20, 2018 17:11
Pipenv configurations

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
.idea/
venv/
@ozcanyarimdunya
ozcanyarimdunya / MultiToSingleDict.py
Last active July 29, 2018 18:06
Multi nested key dictionary to single dictionary
import pandas as pd
class MultiToSingleDict:
def __init__(self, data, sep='.'):
self._data = data
self._sep = sep
self._out = {}