Skip to content

Instantly share code, notes, and snippets.

View irudnyts's full-sized avatar
🏠
Working from home

Iegor Rudnytskyi irudnyts

🏠
Working from home
View GitHub Profile
@irudnyts
irudnyts / manual.py
Last active February 23, 2024 19:35
import pygame
from PCA9685 import PCA9685
def clamp(x):
return max(2500, min(500, x))
pygame.init()
FPS = 30
clock = pygame.time.Clock()
import datetime as dt
import matplotlib.pyplot as plt
import matplotlib.animation as animation
import MacTmp
fig, axs = plt.subplots(3)
xs = []
ys = []
import cv2
import pygame
import numpy as np
from djitellopy import Tello
# --------------
# mediapipe
import mediapipe as mp
from mediapipe.tasks import python
import pygame
from gpiozero import CPUTemperature
pygame.init()
clock = pygame.time.Clock()
screen = pygame.display.set_mode([400, 400])
font = pygame.font.SysFont(None, 400)
cpu = CPUTemperature()
from djitellopy import Tello
import pygame
import cv2
import numpy as np
pygame.init()
screen = pygame.display.set_mode((320, 240))
drone = Tello()
drone.connect()

Workflow of adding an exercise to a chapter

  1. Locate the chapter's <details> tag (it should be at the bottom of the R Markdown file). You can start an exercise right below the <summary>🤸 Вправи</summary> line.

  2. If the exercise does not contain an image or a code block, one can use the jsquiz::generate_mcq() function from the {jsquiz} package. Start by adding a new R code chunk with the following options results='asis', message=FALSE, echo=FALSE, i.e.:

    ```{r, results='asis', message=FALSE, echo=FALSE}
    # your function goes here
#' Create edit
#'
#' Creates a new edit for the provided input, instruction, and parameters. See
#' [this page](https://beta.openai.com/docs/api-reference/edits/create) for
#' details.
#'
#' Given a prompt and an instruction, the model will return an edited version of
#' the prompt.
#'
#' @param engine_id required; a length one character vector. The ID of the
teamR %>% pwalk(send_email)
send_email <- function(...) {
member <- tibble(...)
target <- member %>% pull(target)
email <- member %>% pull(email)
compose_email(
body = md(c(paste0(text, bold(target), "!"), image)),
footer = md("Enjoy your weekend!")
text <- "Ho-ho-ho!
This time of the year has finally came. Christmas tree, Die Hard movies,
mulled wine, what could be better?
That's right, sharing a gift with your
colleague. My magic wand R says you have to prepare a gift for "
bold <- function(name) str_c("**", name, "**")