Skip to content

Instantly share code, notes, and snippets.

View smokku's full-sized avatar

Tomasz Sterna smokku

View GitHub Profile
@jboner
jboner / latency.txt
Last active July 25, 2024 11:30
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@pcolby
pcolby / xmlToVariant.cpp
Last active December 28, 2022 19:44
Sample function for parsing a QXmlStreamReader (or part thereof) to a QVariant tree.
QVariantMap xmlStreamToVariant(QXmlStreamReader &xml, const QString &prefix = QLatin1String("."), const int maxDepth = 1024)
{
if (maxDepth < 0) {
qWarning() << QObject::tr("max depth exceeded");
return QVariantMap();
}
if (xml.hasError()) {
qWarning() << xml.errorString();
return QVariantMap();
@bkaradzic
bkaradzic / orthodoxc++.md
Last active July 19, 2024 23:17
Orthodox C++

Orthodox C++

What is Orthodox C++?

Orthodox C++ (sometimes referred as C+) is minimal subset of C++ that improves C, but avoids all unnecessary things from so called Modern C++. It's exactly opposite of what Modern C++ suppose to be.

Why not Modern C++?

@chrisdone
chrisdone / gist:02e165a0004be33734ac2334f215380e
Last active July 1, 2024 21:55
Build and run minimal Linux / Busybox systems in Qemu

Common

export OPT=/opt
export BUILDS=/some/where/mini_linux
mkdir -p $BUILDS

Linux kernel

@bryc
bryc / YamahaFM.md
Last active July 16, 2024 20:28
Collecting info on Yamaha FM soundchips
@raphendyr
raphendyr / sailfish_install_google_services.md
Last active July 2, 2024 18:47
Google Play Services installation to Sailfish X

Google Play Services for AppSupport in Sailfish OS

This guide is currently updated to Sailfish 4.6. Some things have changed, so check the history if you need guide for an older version.

Devices I have tested the guide:

  • Xperia 10 II
  • Currently not working: Xperia XA2

Requirements

@911992
911992 / c_trigraphs_example.c
Created March 5, 2020 20:26
C trigraphs, and some little tip for obfuscating
%:include <stdio.h>
main(void) ??<
char _vls<:4:>=<%1,3,5,7%>;
printf("val:%d ??/n", 1??(_vls??) );
??>
/*
Above code equals to following code.
Prints 3.
*/
@raysan5
raysan5 / custom_game_engines_small_study.md
Last active July 21, 2024 06:51
A small state-of-the-art study on custom engines

CUSTOM GAME ENGINES: A Small Study

a_plague_tale

A couple of weeks ago I played (and finished) A Plague Tale, a game by Asobo Studio. I was really captivated by the game, not only by the beautiful graphics but also by the story and the locations in the game. I decided to investigate a bit about the game tech and I was surprised to see it was developed with a custom engine by a relatively small studio. I know there are some companies using custom engines but it's very difficult to find a detailed market study with that kind of information curated and updated. So this article.

Nowadays lots of companies choose engines like Unreal or Unity for their games (or that's what lot of people think) because d

@thebluefish
thebluefish / bevy_ex_asset_loading
Created November 26, 2020 02:22
Demonstrates waiting for assets to load asynchronously
use bevy::{prelude::*, asset::LoadState};
fn main() {
App::build()
.add_resource(GameState::Loading)
.add_resource(PendingAssets(Vec::new()))
.add_plugins(DefaultPlugins)
.add_startup_system(load_some_assets.system())
.add_system(loading.system())
.add_system(loaded.system())
@akihikodaki
akihikodaki / README.en.md
Last active July 25, 2024 12:07
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.