Skip to content

Instantly share code, notes, and snippets.

View zelinskiy's full-sized avatar

Nikita M. Yurchenko zelinskiy

View GitHub Profile
using LibraryManagement.Data.Interfaces;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace LibraryManagement.Data.Repository
{
// This class abstracts out the most common basic operations for
import turtle
import math
# даны 2 числа, берем 2 ближайшие к ним точки на ковре улама, считаем кратчайший путь
def prime(n):
if n == 2:
return True
if n % 2 == 0 or n <= 1:
return False
<HTML>
<HEAD>
<TITLE>File Upload Test</TITLE>
</HEAD>
<BODY>
<H1>File Upload Test</H1>
<FORM ENCTYPE = "multipart/form-data"
ACTION="http://localhost:8080/file?filePath=avatars/kek.txt"
METHOD="POST">
import turtle
# draw triangle intersecting points (a, 0) and (0, b)
a, b = 50, 50
turtle.setup(a * 2, b * 2)
t = turtle.Turtle()
t.penup()
for y in range(b):
x = 0
@zelinskiy
zelinskiy / piler.ino
Last active November 27, 2018 10:00
Piler dispenser code for WeMos D1 R1
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
const char* ssid = "faifly_outcast";
const char* password = "Aa123654ff";
ESP8266WebServer server(80);
@zelinskiy
zelinskiy / agda-input.el
Created November 21, 2018 15:03
full Agda unicode
;;; agda-input.el --- The Agda input method
;;; Commentary:
;; A highly customisable input method which can inherit from other
;; Quail input methods. By default the input method is geared towards
;; the input of mathematical and other symbols in Agda programs.
;;
;; Use M-x customize-group agda-input to customise this input method.
;; Note that the functions defined under "Functions used to tweak
#include <LiquidCrystal_I2C.h>
#define SONAR_1_TRIG 7
#define SONAR_1_ECHO 8
#define MAX_SAMPLES 512
#define MAX_DIST 400
// TODO: Control these by potentiometer
// Must be within [10, 10000]
from pymavlink import mavutil, mavwp
import sys, time
if(not (len(sys.argv) == 5 or (len(sys.argv) == 3 and sys.argv[1] != "help"))):
print "USAGE:"
print "1) fly over specific point:"
print "# sudo python fly_over.py udp:127.0.0.1:7001 115200 -35.363265991210938 149.16522216796875"
print "# sudo python fly_over.py /dev/ttyACM0 115200 49.9886078 36.2647748"
print "2) fly over current position:"
print "# sudo python fly_over.py udp:127.0.0.1:7001 115200"
#SIDE A
sudo socat pty,link=/dev/virtualcom0 tcp:IP_B:PORT
#SIDE B
sudo socat tcp-listen:PORT pty,link=/dev/virtualcom0
byte buff[250];
void setup() {
Serial1.begin(9600);
Serial2.begin(9600);
}
void loop() {
if(Serial1.available()){
Serial2.write(buff, Serial1.readBytes(buff, Serial1.available()));