This file contains 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
@classmethod | |
def create_table(self): | |
# TODO 1. Автоматично формувати SQL-команду створення таблиці | |
print("Creating document table") | |
path = os.path.expanduser( | |
"~/python/virtualenv/python3/virt_Python3/home/data.db") | |
try: | |
connection = sqlite3.connect(path) | |
cursor = connection.cursor() | |
cursor.execute( |
This file contains 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
#account setup | |
username = '***'; | |
password = '***'; | |
server = 'smtp.gmail.com:587'; | |
#imports | |
from time import sleep; | |
import smtplib; | |
from email.mime.application import MIMEApplication | |
from email.mime.text import MIMEText; |
This file contains 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
ssh user@host | |
export DISPLAY=:0 | |
export XAUTHORITY=/home/user/.Xauthority | |
notify-send 'А ну отошёл от моего компа!' |
This file contains 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
# coding: utf-8 | |
# author: damirazo | |
from django.views.generic import ListView | |
from models import Post | |
class Posts(ListView): | |
""" | |
Список всех доступных статей | |
""" |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Форма и progressive enhancement</title> | |
</head> | |
<body> | |
<form class="login" method="post" action=""> | |
<label for="login">Логин</label> | |
<input type="text" id="login" name="login" /> | |
<label for="password">Пароль</label> |
This file contains 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
shinyServer(function(input, output, clientData) { | |
output$myImage <- renderImage({ | |
# A temp file to save the output. | |
# This file will be removed later by renderImage | |
outfile <- tempfile(fileext='.png') | |
# Generate the PNG | |
png(outfile, width=400, height=300) | |
hist(rnorm(input$obs), main="Generated in renderImage()") | |
dev.off() |