Skip to content

Instantly share code, notes, and snippets.

View junghan0611's full-sized avatar
🎯
Focusing

JunghanKim junghan0611

🎯
Focusing
  • 14:23 (UTC +09:00)
View GitHub Profile
@jboner
jboner / latency.txt
Last active April 18, 2024 17:18
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
@hugcis
hugcis / publish.el
Created June 16, 2021 14:08
Elisp script with functions to export my notes to Hugo-markdown with ox-hugo
;;; publish --- Summary
;;; Commentary:
(require 'find-lisp)
;;; Code:
(defun hugcis/publish-note (file)
"Publish a note in FILE."
(with-current-buffer (find-file-noselect file)
(projectile-mode -1)
(setq org-hugo-section "notes"
@application2000
application2000 / how-to-install-latest-gcc-on-ubuntu-lts.txt
Last active February 21, 2024 03:02
How to install latest gcc on Ubuntu LTS (12.04, 14.04, 16.04)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497
To install gcc-6 (gcc-6.1.1), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@abcdw
abcdw / nix vs guix.org
Last active February 17, 2024 14:21
nix vs guix.org

Nix vs Guix

These are notes to the stream: https://youtu.be/S9V-pcTrdL8

Some notes

  • We are not aware of a lot of GNU software available to us.
  • Seems that Guix more hacker-friendly/explorable.

General comparsion

DescriptionNixGuixComment
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; BACK UP YOUR LOGSEQ DIR BEFORE RUNNING THIS!
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Copyright (C) Aug 4 2022, William R. Burdick Jr.
;;
;; LICENSE
;; This code is dual-licensed with MIT and GPL licenses.

SPC

SPC (Jump to word)

TAB (Previous buffer visible in window)

! (Run shell command)

’ (Pop up shell)

* / (Search in project)

0,1,…,9 (Jump to window)

: (Run M-x)

; (Comment operator)

? (Helm session with keybindings)

@masatoi
masatoi / deepl.el
Last active September 8, 2023 15:47
emacs deepl client
;;; Install
;; requestが必要なので M-x package-install request などでインストールしておく
;; init.elなどでロードする
;; (load-file "/path/to/deepl.el")
;; キーバインドを設定しておく
;; (global-set-key (kbd "C-c t") 'deepl-translate)
;;; Usage
;; 翻訳したい部分をリージョン選択して設定したキーバインド、または M-x deepl-translate
;; 翻訳結果がミニバッファに出る。また、同じ内容がクリップボードにコピーされている
@davedice
davedice / InflatableSeqLock.cpp
Last active January 17, 2021 00:53
Inflatable SeqLock
// InflatableSeqLock
// Copyright(C) 2016 Oracle and/or its affiliates
// Dave Dice : https://blogs.oracle.com/dave
//
// Remarks:
// * Implements composite writer mutex and seqlock in a single word-sized lock.
// Allows optimistic reading and pessimistic writing.
// Readers don't write to shared synchronization metadata, which helps avoid
// coherence traffic. Readers must tolerate observing inconsistent state, however.
// * Writer mutex is based on LIFO-CR lock from http://arxiv.org/abs/1511.06035.