Skip to content

Instantly share code, notes, and snippets.

@breakcore2
breakcore2 / notes.md
Last active December 6, 2023 10:19
Ligne Claire Anime v1 Release Notes
@destan
destan / ParseRSAKeys.java
Last active October 28, 2024 07:07
Parse RSA public and private key pair from string in Java
import java.io.IOException;
import java.net.URISyntaxException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.security.KeyFactory;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.interfaces.RSAPublicKey;
import java.security.spec.InvalidKeySpecException;
import java.security.spec.PKCS8EncodedKeySpec;
@vbfox
vbfox / Dapper.fs
Last active April 21, 2022 02:58
Minimal dapper in F#
module DapperFSharp =
open System.Data.SqlClient
open System.Dynamic
open System.Collections.Generic
open Dapper
let dapperQuery<'Result> (query:string) (connection:SqlConnection) =
connection.Query<'Result>(query)
let dapperParametrizedQuery<'Result> (query:string) (param:obj) (connection:SqlConnection) : 'Result seq =
# www.fduran.com
# exclude a process from being killed by oom killer
echo -17 > /proc/$PID/oom_adj
# The possible values of oom_adj range from -17 to +15. The higher the score, more likely the associated process is to be killed by OOM-killer: https://lwn.net/Articles/317814/
@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

@markusl
markusl / brainfuck.fs
Created August 11, 2011 17:31
Brainfuck interpreter written in F#
// FSharp (F#) interpreter for brainfuck programming language
// Read more from
// - http://www.muppetlabs.com/~breadbox/bf/
// - http://fsharp.net
// (c) 2011 Markus Lindqvist
module brainfuck
open System
let brainfuckMemorySize = 30000