Skip to content

Instantly share code, notes, and snippets.

// The algorithm
// 1. Create http request
// 2. Attach the access token to the http request headers
// 3. If there is no access token stored in memory:
// 3.1 Notify user that username/password must be provided
// 2.2 On User input create another request to the authentication server, retrieve access token and store it in memory.
// 4. Attach token, execute request and return results
// This is a GUI app, so user will be presented with some modal window asking for login and password.
@pminiszewski
pminiszewski / test.cpp
Last active April 21, 2021 09:50
problems with eigen and entt - minimal reproduction code
//include eigen and entt
typedef Eigen::Matrix<double, 3, 1, Eigen::DontAlign> TestVector;
struct TestXForm
{
TestVector position_;
};
int main(int argc, char** argv)
{
./RunUAT.sh BuildGraph -target="Make Installed Build Linux" -script=Engine/Build/InstalledEngineBuild.xml -set:HostPlatformEditorOnly=true -set:GameConfigurations=Development -set:WithDDC=false
<?xml version="1.0" encoding="utf-8"?>
<RunReport>
<version>2</version>
<gameModeName>ClassicRun</gameModeName>
<gameResultType>Lost</gameResultType>
<seed>18018161866334567102</seed>
<snapshotTime>19986.32</snapshotTime>
<runStopwatchValue>17635.87</runStopwatchValue>
<ruleBook>Difficulty.Normal Artifacts.Bomb.Off Artifacts.Command.Off Artifacts.EliteOnly.Off Artifacts.Enigma.Off Artifacts.FriendlyFire.Off Artifacts.Glass.Off Artifacts.MixEnemy.Off Artifacts.MonsterTeamGainsItems.Off Artifacts.RandomSurvivorOnRespawn.Off Artifacts.Sacrifice.Off Artifacts.ShadowClone.Off Artifacts.SingleMonsterType.Off Artifacts.Swarms.Off Artifacts.TeamDeath.Off Artifacts.WeakAssKnees.Off Artifacts.WispOnDeath.Off Items.Syringe.On Items.Bear.On Items.Tooth.On Items.CritGlasses.On Items.Hoof.On Items.Mushroom.On Items.Crowbar.On Items.BleedOnHit.On Items.WardOnLevel.On Items.HealWhileSafe.On Items.PersonalShield.On Items.Medkit.On Items.IgniteOnKill.On Items.StunChanceOnHit.On Items.Firework.On Items.SprintBonus
@pminiszewski
pminiszewski / client.rs
Last active May 23, 2019 21:56
tokio snippet for continous reconnection when server is offline.
extern crate futures;
extern crate tokio;
extern crate failure;
use tokio::net::TcpStream;
use tokio::prelude::*;
use future::{loop_fn, Loop, Future};
fn connect() -> impl Future<Item = TcpStream, Error = std::io::Error> {