Skip to content

Instantly share code, notes, and snippets.

@jart
jart / trace.cpp
Last active November 13, 2024 16:18
Easy high performance chrome://tracing output for C++
// -*- mode:c;indent-tabs-mode:nil;c-basic-offset:4;coding:utf-8 -*-
// vi: set et ft=c ts=4 sts=4 sw=4 fenc=utf-8 :vi
#define _GNU_SOURCE
#include <pthread.h>
#include <stdatomic.h>
#include <stdbool.h>
#include <stdio.h>
#include <threads.h>
#include <unistd.h>
@p3x-robot
p3x-robot / ntfs-file-system-increase-speed-performance.com
Last active August 2, 2024 02:21
🚄 This is a simple utility to increase the NTFS performance by turning off some NTFS features that are not so used by now (or not so important).
rem execute as an Administrator
rem based on http://www.windowsdevcenter.com/pub/a/windows/2005/02/08/NTFS_Hacks.html
ram based on https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/cc938961(v=technet.10)
rem http://archive.oreilly.com/cs/user/view/cs_msg/95219 (some installers need 8dot3 filenames)
rem disable 8dot3 filenames
ram Warning: Some applications such as incremental backup utilities rely on this update information and do not function correctly without it.
fsutil behavior set disable8dot3 1
@preshing
preshing / main.cpp
Created January 3, 2018 21:54
Use SFINAE to call member function if present
#include <iostream>
class Foo {
public:
void bar() {
std::cout << "Foo::bar() called" << std::endl;
}
};
class Foo2 {
@lava
lava / hello_world.md
Last active March 2, 2024 17:22
Hello, world: Deep analysis of a shallow program.

Hello, world!

Please explain in detail what will happen if the following program is executed:

#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
}