Skip to content

Instantly share code, notes, and snippets.

View ItsTauTvyDas's full-sized avatar
☁️
don't even know

Tautvydas ItsTauTvyDas

☁️
don't even know
View GitHub Profile
@ItsTauTvyDas
ItsTauTvyDas / maths-eval-from-wstring.cpp
Last active November 9, 2025 22:47
C++ math evaluation from wstring (converted from https://stackoverflow.com/a/26227947)
// Original code in Java (https://stackoverflow.com/a/26227947) converted to C++ with some extra features
// Added most of math functions from standart C++ library
// Added number handler in function names (e.g. log10(...))
// Gives out error wstring instead of throwing an exception, just check if error isn't empty
// Added multiple arguments support for functions
// Constants
// Note that str will get modified, this is intented (I needed it, change this on your own)
@ItsTauTvyDas
ItsTauTvyDas / SimpleSessionReader.php
Last active September 21, 2022 20:03
Simple PHP session file reader.
<?php
namespace Reader;
class SimpleSessionReader
{
public $text;
public $array = [];
public function __construct(string $text = "")
@ItsTauTvyDas
ItsTauTvyDas / bot.js
Created August 8, 2018 16:25
How to ignore annoying "Module not found" (In console) error in command handler - Discord.JS. Story: I was searching this in google and I didn't find it! After thinking, I code myself! (You will need Fs (File System))
//Btw, this is command handler, I have used this tutorial in https://anidiots.guide/first-bot/a-basic-command-handler
const Discord = require("discord.js");
const fs = require("fs"); // <-- File system
var prefix = "?"; // <-- Commands Prefix
fs.readdir("./events/", (err, files) => {
if (err) return console.error(err);
files.forEach(file => {
let eventFunction = require(`./events/${file}`);
let eventName = file.split(".")[0];