Skip to content

Instantly share code, notes, and snippets.

@technix
technix / jumpdrive-no_fall_through.patch
Last active December 14, 2019 10:39
Minetest jumpdrive mod patch to avoid falling through floor
From 4e9c6e5822f884c0d113a06fee5507b274fddc8e Mon Sep 17 00:00:00 2001
From: techniX <sergei.mozhaisky@gmail.com>
Date: Sat, 14 Dec 2019 12:21:55 +0200
Subject: [PATCH] No fall through while jumping: - temporary disable gravity
and player movement - re-enable gravity and player movement 3 sec after jump
- sometimes player still falls through, so place player into right position 3
sec after jump - disallow jump if gravity is not enabled yet - i.e.
immediately after jump
---
@technix
technix / atrament-bot.js
Created January 29, 2019 10:18
Telegram bot for choice-based games
const fs = require('fs');
const TelegramBot = require('node-telegram-bot-api');
const atrament = require('./atrament');
const token = 'SECRET-TOKEN-HERE';
const bot = new TelegramBot(token, {polling: true});
let chatId;
const kbdMessage = {};
@technix
technix / promise-wait.js
Last active March 10, 2024 14:22
Wait for variable to become true - in promise
window.testVar = null;
function waitForCondition (variable) {
function waitFor(result) {
if (result) {
return result;
}
return new Promise((resolve) => setTimeout(resolve, 100))
.then(() => Promise.resolve(window[variable]))
.then((res) => waitFor(res));

Keybase proof

I hereby claim:

  • I am technix on github.
  • I am technix (https://keybase.io/technix) on keybase.
  • I have a public key whose fingerprint is 13D6 F2CA 45F6 773E FA89 C2EB 0A02 09D5 C913 C9C4

To claim this, I am signing this object:

@technix
technix / getmul.pl
Created February 13, 2012 10:32 — forked from spiculator/getmul.pl
getmul
#!/usr/bin/perl
use warnings;
use strict;
sub getmul($$$$) {
my $num = shift;
my $num2 = $num % 100;
my $last = $num2 % 10;
my $case = $num2 > 4 && $num2 < 21 ? 2 :
1 == $last ? 0 :
$last > 1 && $last < 5 ? 1