This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
web: | |
restart: always | |
build: ./web | |
expose: | |
- "8000" | |
links: | |
- postgres:postgres | |
- redis:redis | |
volumes: | |
- /usr/src/app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi $(docker images -q) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.6 | |
# coding: utf-8 | |
""" | |
Çok Satırlı yorum: | |
Python Guido Van Rossum tarafından 90'ların başında geliştirilmeye | |
başlanmıştır. | |
""" | |
# Bu da bir tek satırlık yorum örneğidir. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
import sys | |
def get_constants(prefix): | |
"""Create a dictionary mapping socket module constants to their names.""" | |
return dict((getattr(socket, n), n) | |
for n in dir(socket) | |
if n.startswith(prefix) | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import paho.mqtt.client as mqtt | |
# This is the Publisher | |
client = mqtt.Client() | |
client.connect("ip_Adress",1883,60) | |
client.publish("temp/random", 5) | |
client.disconnect() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SimpleMiddleware(object): | |
def __init__(self, get_response): | |
self.get_response = get_response | |
def __call__(self, request): | |
response = self.get_response(request) | |
print('USER: {}'.format(request.user)) | |
return response |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
from django.utils.deprecation import MiddlewareMixin | |
class SimpleMiddleware(MiddlewareMixin): | |
def process_request(self, request): | |
pass | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class decorator_with_arguments(): | |
def __init__(self, arg1, arg2, arg3): | |
""" | |
__init__ kısmı bizim constructor bölümüdür. | |
@decerator_with_arguments(arg1,arg2,arg3) parametrelerini alır. | |
""" | |
print("__init__() Çalıştı ...") | |
# Değişken atamaları yapılır. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% load mptt_tags %} | |
<ul> | |
{% recursetree nodes %} | |
<li> | |
{{ node.title }} | |
<br> | |
{{ node.image.url }} | |
{% if not node.is_leaf_node %} | |
<ul class="children"> | |
{{ children }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def arguman(arg): | |
def wrap(func): | |
def func_wrapper(name): | |
return "{} {}".format(arg, func(name)) | |
return func_wrapper | |
return wrap | |
@arguman("Merhaba") | |
def get_text(name): |