Skip to content

Instantly share code, notes, and snippets.

View zicklag's full-sized avatar
🛰️
Making awesome stuff!

Zicklag zicklag

🛰️
Making awesome stuff!
View GitHub Profile
@jboner
jboner / latency.txt
Last active July 17, 2024 03:12
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
@fideloper
fideloper / update_curl.sh
Last active January 11, 2024 15:23
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@briansmith
briansmith / how-to-generate-and-use-private-keys-with-openssl-tool.md
Last active April 11, 2024 17:02
How to generate & use private keys using the OpenSSL command line tool

How to Generate & Use Private Keys using OpenSSL's Command Line Tool

These commands generate and use private keys in unencrypted binary (not Base64 “PEM”) PKCS#8 format. The PKCS#8 format is used here because it is the most interoperable format when dealing with software that isn't based on OpenSSL.

OpenSSL has a variety of commands that can be used to operate on private key files, some of which are specific to RSA (e.g. openssl rsa and openssl genrsa) or which have other limitations. Here we always use

@paulera
paulera / exploding-cards.md
Last active June 13, 2024 00:07
Exploding cards: Explodding Kittens variant, with regular playing cards

Exploding cards

This is a variant of the Exploding Kittens game rules, using regular playing cards

  • 1 deck: 3 to 8 players
  • 2 decks: up to 16 players

Objective

The last survivor wins the game. If you draw a Bomb card and don't have a Disarm card, you die.

Preparing the game

@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active May 19, 2024 10:45
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}
@HadrienG2
HadrienG2 / High_Performance_Rust.md
Last active July 2, 2024 08:11
Making Rust a perfect fit for high-performance computations

Hello, Rust community!

My name is Hadrien and I am a software performance engineer in a particle physics lab. My daily job is to figure out ways to make scientific software use hardware more efficiently without sacrificing its correctness, primarily by adapting old-ish codebases to the changes that occured in the software and computing landscape since the days where they were designed:

  • CPU clock rates and instruction-level parallelism stopped going up, so optimizing code is now more important.
  • Multi-core CPUs went from an exotic niche to a cheap commodity, so parallelism is not optional anymore.
  • Core counts grow faster than RAM prices go down, so multi-processing is not enough anymore.
  • SIMD vectors become wider and wider, so vectorization is not a gimmick anymore.
@zicklag
zicklag / Creating a Proxy Proxy for Skipping Proxy Authentication Prompts.md
Last active January 13, 2021 08:12
How to setup a proxy for skipping proxy authentication prompts.

Creating a Proxy Proxy for Skipping Proxy Authentication Prompts

Update

I found an easier way to do this with a Go program that doesn't require writing a script and installing node. Check out this comment.

Original Solution

Some programs support a proxy, but they don't support authentication without prompting. This is the case with Chrome and VSCode. This caused me problems particularly when trying to automate Chrome with Selenium. The workaround is to run a local proxy, set your http_proxy environment variables to the local proxy, and tell the local proxy to, in turn, proxy requests to your real proxy and to include your username and password.

@DallasC
DallasC / linfa-eco.md
Created December 11, 2019 03:23
Rust AI Algorithm Ecosystem

Interesting general purpose crates to consider

peroxide

Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with farmiliar syntax

Bindings

faiss

Rust language bindings for Faiss, the state-of-the-art vector search and clustering library.

liblinear

Rust bindings for the liblinear C/C++ library. Provides a thin (but rustic) wrapper around the original C-interface exposed by the library.

@zicklag
zicklag / .gitignore
Created February 28, 2020 20:48
These are the coolest two lines that should be in *every* .gitignore file
# Ignore everything that has "gitignore" in the name, except for the .gitignore file
*gitignore*
!.gitignore
# This makes it super easy to backup source files and other resources that you happen to want in your repo
# dir at the moment, but that you don't want to end up accidentally commiting.
@johnchandlerburnham
johnchandlerburnham / ATaxonomyOfSelfTypes.md
Last active May 2, 2024 16:33
A Taxonomy of Self Types

A Taxonomy of Self-Types

Part I: Introduction to Self-Types

Datatypes in the Formality programming language are built out of an unusual structure: the self-type. Roughly speaking, a self-type is a type that can depend or be a proposition on it's own value. For instance, the consider the 2 constructor datatype Bool: