Skip to content

Instantly share code, notes, and snippets.

View narimiran's full-sized avatar

Miran narimiran

View GitHub Profile
@kiran-kp
kiran-kp / 2020.rkt
Last active January 23, 2021 00:05
Advent of Code 2020
#lang racket
(require (prefix-in data: "2020_data.rkt"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(module+ day1
(define expenses (map string->number (string-split (data:day1) #:trim? #t #:repeat? #t)))
(define sum-is-2020? (compose (curry = 2020) (curry apply +)))
(define (part1)
NOTE: The imports are found by simple walking throught the AST and looking after `nkFromStmt` and `nkImportStmt` nodes.
The stdlib modules are identified by simple string comparisions.
This method is not entirely accurate, but it does give some indication of which modules are used and which are not.
File imports (tot: 14078)
0 volatile
0 db_odbc
0 asyncftpclient
0 punycode
0 ssl
@juancarlospaco
juancarlospaco / 0README.md
Last active June 8, 2021 19:14
Python Versus Nim: Async

Python Versus Nim: Async

  • No performance benchmark.
  • Python ⟿ PEP-8
  • Nim ⟿ NEP1
  • Python ⟿ 3.7
  • Nim ⟿ 0.19
  • No Ofuscation, no Code-Golf.

This is to compare elegant, simple, expressive code.

@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs