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
#include <Servo.h> | |
#define PIN_PHOTO_SENSOR A0 | |
#define PIN_SERVO 11 | |
#define LIGHT_LIMIT_K 80 | |
#define MAX_POSITIVE_SPEED 180 | |
#define MAX_NEGATIVE_SPEED 0 | |
#define REST_SPEED 90 |
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 manim import * | |
class Sample(Scene): | |
def construct(self): | |
ellipse1 = Ellipse( | |
width=4.0, height=5.0, fill_opacity=0.5, color=BLUE, stroke_width=10 | |
).move_to(LEFT) | |
ellipse2 = ellipse1.copy().set_color(RED).move_to(RIGHT) |
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
# Based on https://www.youtube.com/watch?v=u8zLAUroUq8&ab_channel=WildMathing | |
from manim import * | |
from numpy.random import uniform | |
# WORDS = ( | |
# r"e^{i/pi}+1=0", | |
# r"3^2+4^2=5^2", | |
# r"V+F-E=2", | |
# r"\exists", |
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 TelegramBot from "node-telegram-bot-api"; | |
export type UseHandler<ContextType> = ( | |
message: TelegramBot.Message | undefined, | |
metadata: TelegramBot.Metadata | undefined, | |
query: TelegramBot.CallbackQuery | undefined, | |
context: ContextType, | |
next: () => void | |
) => void; |
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 merge_sort(array: list): | |
length = len(array) | |
buff = [0 for _ in range(length)] | |
def merge_sort_master(start_index, finish_index): | |
size = finish_index - start_index + 1 | |
if size < 2: | |
return |
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 quick_sort(array: list): | |
def quick_sort_master(start_index, finish_index): | |
pivot = array[(start_index + finish_index) // 2] | |
left_index = start_index | |
right_index = finish_index | |
while left_index <= right_index: | |
while array[left_index] < pivot: | |
left_index += 1 | |
while array[right_index] > pivot: |
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
const getType = (x: any) => Object.prototype.toString.call(x).slice(8, -1); | |
// prettier-ignore | |
const primitiveTypes = ["Number", "String", "Boolean", "Null", "BigInt", 'Symbol', 'Undefined']; | |
const isPrimitiveType = (x: any) => primitiveTypes.includes(getType(x)); | |
export const getCopy = (x: any) => { | |
if (isPrimitiveType(x)) { | |
return x; | |
} |
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
// https://www.codewars.com/kata/5296bc77afba8baa690002d7 | |
const puzzle = [ | |
[5, 3, 0, 0, 7, 0, 0, 0, 0], | |
[6, 0, 0, 1, 9, 5, 0, 0, 0], | |
[0, 9, 8, 0, 0, 0, 0, 6, 0], | |
[8, 0, 0, 0, 6, 0, 0, 0, 3], | |
[4, 0, 0, 8, 0, 3, 0, 0, 1], | |
[7, 0, 0, 0, 2, 0, 0, 0, 6], | |
[0, 6, 0, 0, 0, 0, 2, 8, 0], |
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
async function byProgress(response, progressHandler) { | |
const reader = response.body.getReader(); | |
const chunks = []; | |
let length = 0; | |
while (true) { | |
const { done, value } = await reader.read(); | |
if (done) { | |
break; |
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
const { readdir, rename } = require("fs/promises"); | |
const { resolve } = require("path"); | |
(async () => { | |
const __dirname = resolve(); | |
const tracks = (await readdir(__dirname)) | |
.map((name) => { | |
const match = name.match(/(\d{4})-(\d{2})-(\d{2}) (\d{2})-(\d{2})-(\d{2}).mp4/i); |
NewerOlder