Skip to content

Instantly share code, notes, and snippets.

View rbento's full-sized avatar

Rodrigo Bento rbento

  • Toronto
View GitHub Profile
@macton
macton / Dockerfile
Last active November 5, 2023 02:07
Unity on CentOS 7 on WSL2
# syntax=docker/dockerfile:1
FROM centos:7 as stage-1
##
## Install unityhub, chromimum, visual studio code, dotnet, gcc10 (+dependencies)
##
RUN yum -y install centos-release-scl-rh
RUN yum -y install epel-release
RUN yum -y install http://www.nosuchhost.net/~cheese/fedora/packages/epel-7/x86_64/cheese-release-7-1.noarch.rpm
@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++?

@macton
macton / cpuid_features.c
Last active November 5, 2023 02:04
Print cpuid features
// This file: https://gist.github.com/macton/4dd5fec2113be284796e
// See: Intel Intrinsics Guide https://software.intel.com/sites/landingpage/IntrinsicsGuide/
// See: CPUID Explorer http://www.flounder.com/cpuid_explorer1.htm
// See: Playing with cpuid http://newbiz.github.io/cpp/2010/12/20/Playing-with-cpuid.html
// See: MSDN __cpuid, __cpuidex http://msdn.microsoft.com/en-us/library/hskdteyh.aspx
// See: Notes on MMX/SSE and a searchable table of intrinsics. http://www.taffysoft.com/pages/20120418-01.html
// See: AMD CPUID Specification http://amd-dev.wpengine.netdna-cdn.com/wordpress/media/2012/10/25481.pdf
#if defined(__GNUC__)
#include <stdint.h>
@macton
macton / linux_tips.txt
Last active November 5, 2023 02:05
Random Linux tips
-------------------------------------------------------------------------------------------------------------
View process memory info
$ cat /proc/<process_id>/smaps
-------------------------------------------------------------------------------------------------------------
Overall memory info
http://stackoverflow.com/a/13754307
$ smem
-------------------------------------------------------------------------------------------------------------
@jboner
jboner / latency.txt
Last active July 22, 2024 14:44
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