Skip to content

Instantly share code, notes, and snippets.

View NickSablukov's full-sized avatar
🦥

Nick Sablukov NickSablukov

🦥
  • Wheely
  • Cyprus
View GitHub Profile
@NickSablukov
NickSablukov / news_models.py
Created April 9, 2015 13:32
homework_django
from django.db import models
# Create your models here.
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="MyProject/settings.py" />
<option name="manageScript" value="manage.py" />
<option name="environment" value="&lt;map/&gt;" />
</configuration>
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="FacetManager">
<facet type="django" name="Django">
<configuration>
<option name="rootFolder" value="$MODULE_DIR$" />
<option name="settingsModule" value="MyProject/settings.py" />
<option name="manageScript" value="manage.py" />
<option name="environment" value="&lt;map/&gt;" />
</configuration>
# coding: utf-8
import os, sys, re, argparse
class FileObject(object):
lines = None
def __init__(self, file_path=None, *args, **kwargs):
with open(file_path, 'r') as file_:
self.lines = file_.readlines()
# coding: utf-8
import argparse
import sys
def main(file_path):
symbol = '#'
with open(file_path, 'r') as file_:
for line in file_.readlines():
# coding: utf-8
import serial
import os, sys
import signal
import datetime
TRANSFER_RATE = '9600'
MOUNT_BASE_DIR = '/dev/ttyACM'
PATH_TO_LOGS = 'monitoring_logs'
#include <Servo.h>
#include <Ultrasonic.h>
Servo myservo;
Ultrasonic ultrasonic(8, 13);
String splitter = ",";
void setup()
{
myservo.attach(9);
#include <Servo.h>
#include <Ultrasonic.h>
#define usTRIG 12
#define usECHO 8
#define servoPIN 11
Servo servo;
void setup() {
from collections import OrderedDict
def main():
x_min = float(input('Первое значение в диапозоне: '))
x_max = float(input('Второе значение в диапозоне: '))
h = float(input('Шаг: '))
intervals = generate_intervals_size(x_min, x_max, h);
with open('numbers', 'r') as f:
class MkbView(ListAPIView):
queryset = models.Mkb.objects.all()
serializer_class = serializers.Mkb
filter_class = filters.Mkb
def list(self, request, *args, **kwargs):
object_list = super().list(request, *args, **kwargs).data
return Response({
'results': [
{