Skip to content

Instantly share code, notes, and snippets.

View lenarddome's full-sized avatar
🙊

Lenard Dome lenarddome

🙊
View GitHub Profile
@jboner
jboner / latency.txt
Last active July 27, 2024 12:32
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
@anhqle
anhqle / correlation-table.R
Last active December 16, 2020 02:17
R code to create pretty correlation table (+ Latex output) Source: somewhere on the Internet
library(xtable)
corstarsl <- function(x){
require(Hmisc)
x <- as.matrix(x)
R <- rcorr(x)$r
p <- rcorr(x)$P
## define notions for significance levels; spacing is important.
mystars <- ifelse(p < .001, "***", ifelse(p < .01, "** ", ifelse(p < .05, "* ", " ")))
@pdparker
pdparker / APAstyle
Created June 17, 2015 23:17
APA Style for Markdown
/* I have only tested this on Chrome but it
prints nicely to A4 size */
@media print {
body {
width: 210mm;
height: 297mm;
}
}
@fortytw2
fortytw2 / excuses.txt
Last active April 14, 2024 04:59
programming excuses
Actually, that's a feature
Don't worry, that value is only wrong half of the time
Even though it doesn't work, how does it feel?
Everything looks fine my end
How is that possible?
I broke that deliberately to do some testing
I can have a look but there's a lot of if statements in that code!
I can't make that a priority right now
I can't test everything
I couldn't find any examples of how that can be done anywhere else in the project
@aembleton
aembleton / docx2md.md
Last active May 17, 2023 07:04 — forked from vdavez/docx2md.md
Convert a Word Document into MD

Converting a Word Document to Markdown in One Move

The Problem

A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.

Installing Pandoc

On a mac you can use homebrew by running the command brew install pandoc.

The Solution

@mraza007
mraza007 / talks_2018
Created January 24, 2021 06:04
Compiled list of interesting talks according to HN (2018 Edition)
Q: Why Do Keynote Speakers Keep Suggesting That Improving Security Is Possible? A: Because Keynote Speakers Make Bad Life Decisions and Are Poor Role Models | USENIX
usenix_logo_notag_white - https://www.usenix.org/conference/usenixsecurity18/presentation/mickens
The Wisdom of James Mickens | James Mickens - https://mickens.seas.harvard.edu/wisdom-james-mickens
What Bodies Think About: Bioelectric Computation Outside the Nervous System - NeurIPS 2018 - YouTube - https://www.youtube.com/watch?v=RjD1aLm4Thg
Maybe Not - Rich Hickey - YouTube - https://www.youtube.com/watch?v=YR5WdGrpoug
Text.Parsec.Combinator - http://hackage.haskell.org/package/parsec-3.1.13.0/docs/Text-Parsec-Combinator.html#v:optionMaybe
Byrne&#039;s Blog &raquo; Blog Archive &raquo; Why Are Middlebrow Dismissals So Tempting? - http://www.byrnehobart.com/blog/why-are-middlebrow-dismissals-so-tempting/
Contracts For Getting More Programs Less Wrong - Strange Loop - https://www.thestrangeloop.com/2018/contracts-for-getting-more-programs-less