Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View Turim's full-sized avatar

Alexander Enaldiev Turim

View GitHub Profile
@mdonkers
mdonkers / server.py
Last active April 22, 2024 21:31
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
License: MIT License
Copyright (c) 2023 Miel Donkers
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
@UnaNancyOwen
UnaNancyOwen / find_avx.cmake
Last active February 22, 2024 04:01
Check for the presence of AVX and figure out the flags to use for it.
# Check for the presence of AVX and figure out the flags to use for it.
macro(CHECK_FOR_AVX)
set(AVX_FLAGS)
include(CheckCXXSourceRuns)
set(CMAKE_REQUIRED_FLAGS)
# Check AVX
if(MSVC AND NOT MSVC_VERSION LESS 1600)
set(CMAKE_REQUIRED_FLAGS "/arch:AVX")
@remelpugh
remelpugh / AccountUtils.java
Created November 14, 2012 15:08 — forked from imminent/AccountUtils.java
Utility to retrieve user profile on Android device
/**
* A collection of authentication and account connection utilities. With strong inspiration from the Google IO session
* app.
* @author Dandré Allison
*/
public class AccountUtils {
/**
* Interface for interacting with the result of {@link AccountUtils#getUserProfile}.
*/
@jboner
jboner / latency.txt
Last active April 22, 2024 15:20
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