Skip to content

Instantly share code, notes, and snippets.

View a-ostretsova's full-sized avatar

Anastasia Ostretsova a-ostretsova

View GitHub Profile
@lightsongjs
lightsongjs / gist:55241af63761ddfa820e32c7ca0d81de
Created December 3, 2024 09:10
converts all .mkv files in the current directory to .mp4
@echo off
:: This script converts all .mkv files in the current directory to .mp4 format
:: using ffmpeg. Make sure ffmpeg is installed and available in the system PATH.
setlocal enabledelayedexpansion
:: Loop through all .mkv files in the current directory
for %%f in (*.mkv) do (
:: Set the base name by removing the file extension
set "basename=%%~nf"
@ricsirigu
ricsirigu / ConditionalRendering.scala
Last active July 11, 2019 10:40
How to dynamically render HTML with Scala and the Lift framework
class ConditionalRendering{
def render: (NodeSeq) => NodeSeq = {
"#content-container" #> {if(trueness) PassThru else ClearNodes} andThen
"#inclusions" #> {".inclusions-text *" #> { List("food", "drinks") } }
}
}
@jboner
jboner / latency.txt
Last active April 23, 2025 18:02
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