Skip to content

Instantly share code, notes, and snippets.

@smarenkov
smarenkov / merge_intervals.dart
Last active May 7, 2023 21:01
Solving a problem from an interview about merge intervals
List<List<int>> mergeIntervals(List<List<int>> intervals) {
//The intervals should be sorted
//Creating a clone of intervals if we don't want the original intervals to be sorted
final clonedIntervals = List.from(intervals)
..sort((a, b) => a.first.compareTo(b.first));
List<List<int>> mergedIntervals = [];
mergedIntervals.add(clonedIntervals.first);
for (final interval in clonedIntervals) {
@smarenkov
smarenkov / telegram_web_k_spam.js
Last active September 18, 2024 06:38
telegram web k spam script
const message = "Test Message";
const interval = 300; // seconds
const sendMessage = (msg) => {
const inputField = document.getElementsByClassName('input-message-input')[0];
const sendButton = document.querySelector('.btn-send');
inputField.innerHTML = msg;
sendButton.click();
console.log('Message sent:', msg);
@smarenkov
smarenkov / taskfile.yaml
Created September 26, 2024 03:16
taskfile example
# Check for the latest version here: https://taskfile.dev/taskfile-versions
version: "3"
tasks:
echo:
desc: "Test echo command"
cmds:
- echo "Hello World"