Skip to content

Instantly share code, notes, and snippets.

View emlai's full-sized avatar

Emil Laine emlai

View GitHub Profile
@emlai
emlai / Game Engine Comparison Table.md
Last active March 12, 2024 23:31
Game Engine Comparison Table

Disclaimer: this is fundamentally a subjective comparison, and your mileage may vary, but I'll try to keep it as objective as I can anyway. Do comment if you have suggestions on what to change or add.

Godot Unity Unreal
Overview
Console support - + +
Maturity - + +
2D support ++ ++ -
Open-world performance - + ++
Asset store - ++ +
@emlai
emlai / README.md
Last active March 3, 2020 14:56
Flow service stops working

Still getting this in WebStorm 2019.3.3 and 2020.1 EAP, on Windows 10. Flow version is 0.119.1.

I'm able to temporarily fix this by killing all flow.exe processes in Windows Task Manager, and running "Restart all Flow servers".

The files below with the extension ".old" are before the restart, the other files after the restart.

#include <string>
#include <iostream>
using namespace std;
int main() {
string s = "lollero";
string t = "lerolo";
auto si = s.begin() + 3;
auto ti = t.begin();
@emlai
emlai / .gitignore
Created November 9, 2016 13:11
MCVE for CocoaPods/Xcodeproj issue #446
.DS_Store
/.build
/Packages
/*.xcodeproj
@emlai
emlai / .gitignore
Last active November 5, 2016 14:18
MCVE of "error: in auto-import: failed to get module 'foo' from AST context"
.DS_Store
/.build
/Packages
/*.xcodeproj
@emlai
emlai / Raycast.swift
Last active March 27, 2024 22:18
A 2D integer raycasting algorithm in Swift
var dx = abs(endPoint.x - startPoint.x)
var dy = abs(endPoint.y - startPoint.y)
var x = startPoint.x
var y = startPoint.y
var steps = 1 + dx + dy
let incrementX = (endPoint.x > startPoint.x) ? 1 : -1
let incrementY = (endPoint.y > startPoint.y) ? 1 : -1
var error = dx - dy
dx *= 2
dy *= 2
@emlai
emlai / fast_random_bool_benchmarks.cpp
Last active January 18, 2024 07:21
C++ fast random bool generation benchmarks
#include <random>
#include <chrono>
#include <iostream>
#include <iomanip>
#include <functional>
using namespace std;
using namespace chrono;
const int Count = 1000'000'000;
@emlai
emlai / dirlinecount.sh
Last active August 29, 2015 14:19
Count number of lines in each file in a directory, sort output by line count
wc -l src/*.{cpp,h} | sort -r
# wc "word count" utility
# -l count lines
# src/* in directory named "src"
# *.{cpp,h} files with extension .cpp or .h
# | sort sort output of wc
# -r sort greatest first (reverse order)