Skip to content

Instantly share code, notes, and snippets.

View Rankarusu's full-sized avatar
stuck in vim

Ranka Rankarusu

stuck in vim
  • Germany
View GitHub Profile
@Rankarusu
Rankarusu / generateData.sql
Created July 9, 2025 08:56
Generate lots of data in MySQL
drop procedure if exists doWhile;
SET autocommit=0;
SET unique_checks=0;
SET foreign_key_checks=0;
DELIMITER //
CREATE PROCEDURE doWhile()
BEGIN
DECLARE i INT default 1;
WHILE (i <= 15000000) DO
@Rankarusu
Rankarusu / checkPosition.php
Created December 4, 2025 17:21
Check all surrounding fields in a 2d array, ignoring out of bounds elements
private function checkPosition(int $x, int $y, array $grid): bool
{
$neighbors = [];
$offsets = [
[-1, -1],
[-1, 0],
[-1, 1],
[0, -1],
[0, 1],