Skip to content

Instantly share code, notes, and snippets.

@YaLTeR
YaLTeR / latency.ino
Last active April 4, 2024 13:41
Latency measuring device firmware
#include <Bounce2.h>
// Where I have stuff plugged in on my board.
#define BUTTON_PIN 2
#define LIGHT_PIN 23
// This one is standard for Teensy.
#define LED_PIN 13
// The program repeatedly:
// 1. presses the first key
@YaLTeR
YaLTeR / strafing.ipynb
Last active June 27, 2020 07:45
Differentiable Strafing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@YaLTeR
YaLTeR / taslog-to-hlkz.py
Created May 24, 2020 10:55
BXT TAS log to HLKZ replay converter
#!/usr/bin/python
from itertools import chain
from os import fdopen
from sys import stdin, stdout
import json
import struct
def main():
@YaLTeR
YaLTeR / match.cpp
Created September 20, 2017 21:23
Match expressions for std::visit using simple macros.
#include <iostream>
#include <string>
#include <variant>
using namespace std;
#define MATCH(x) \
using __X_TYPE = std::decay_t<decltype(x)>; \
if constexpr (false)
#define CASE(T) \
#!/usr/bin/env bash
set -ex
# Check your distribution to find out how it runs Steam.
# Replace 1 with 0 if it's not using Steam's bundled libraries.
USE_STEAM_BUNDLED_LIBRARIES=1
# Make sure the paths below do not contain spaces.
# Set this to the full path to the .steam folder, usually ~/.steam
@YaLTeR
YaLTeR / elevators.py
Created February 19, 2017 11:05
Elevator simulation, a university task. Written in Russian for fun.
from enum import Enum
import random
import simpy
ЛИФТ_ВРЕМЯ_ДВИЖЕНИЯ_ДВЕРЕЙ = 3 # секунды
ЛИФТ_СКОЛЬКО_ДВЕРИ_ОТКРЫТЫ = 6 # секунды
ЛИФТ_СЕКУНД_НА_ПЕРВЫЙ_И_ПОСЛЕДНИЙ_ЭТАЖ = 4 # секунды, время проезда первого и последнего этажа (больше из-за ускорения / замедления)
ЛИФТ_СЕКУНД_НА_ЭТАЖ = 4 # секунды, время проезда одного этажа
ЛИФТ_МАКСИМУМ_ПАССАЖИРОВ = 12
ЧИСЛО_ЛИФТОВ = 3
@YaLTeR
YaLTeR / Talos_splits2.py
Created February 6, 2017 17:02
Modified Talos_splits.py by darkid
puzzles = {
'**1': 'A3 Star #2 (ABTU)',
'**2': 'A2 Star (Outside)',
'**3': 'A3 Star #1 (Outside)',
'**4': 'A4 Star (PiF)',
'**5': 'A1 Star (Outside)',
'**6': 'A5 Star #2 (FC)',
'**7': 'A5 Star #1 (TtDWTB)',
'**8': 'A6 Star (Outside)',
'**9': 'A7 Star (TPLB)',
extern crate rand;
use rand::{Rand, Rng};
use std::env;
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
enum Transformation {
Nothing,
Bold,
Italic,
@YaLTeR
YaLTeR / main.rs
Created October 26, 2016 14:33
GoldSrc demo repair tool.
extern crate byteorder;
use byteorder::{ByteOrder, LittleEndian, ReadBytesExt, WriteBytesExt};
use std::env;
use std::ffi::OsString;
use std::fs::File;
use std::io;
use std::io::{Read, Seek, SeekFrom, Write};
use std::path::PathBuf;
@YaLTeR
YaLTeR / LiveSplit.TheTalosPrinciple.asl
Last active September 18, 2016 16:24 — forked from jbzdarkid/LiveSplit.TheTalosPrinciple.asl
Autosplitter for The Talos Principle
state("Talos") {}
init {
var gameDir = Path.GetDirectoryName(modules.First().FileName);
var path = "";
if (game.Is64Bit()) {
path = gameDir.TrimEnd("\\Bin\\x64".ToCharArray()) + "\\Log\\Talos.log";
} else {
path = gameDir.TrimEnd("\\Bin".ToCharArray()) + "\\Log\\Talos.log";
}
try { // Wipe the log file in case there's leftover messages from last time