Skip to content

Instantly share code, notes, and snippets.

View thomasf's full-sized avatar

Thomas Frössman thomasf

View GitHub Profile
@mununki
mununki / user_password_django_pbkdf2_sha256.go
Last active July 21, 2024 19:28
[Go] Implementation Django default password hashing PBKDF2_SHA256 with Go
import (
"crypto/rand"
"crypto/sha256"
"crypto/subtle"
"encoding/base64"
"strconv"
"strings"
"time"
"golang.org/x/crypto/pbkdf2"
@andrzejsliwa
andrzejsliwa / Makefile
Last active December 10, 2017 16:25
simple project for cross development with KICK ASSEMBLER for C64
VICE_REMOTE_MONITOR = true
VICE_REU = true
VICE_CARTRR = cartridge/rr38p-tmp12reu.bin
VICE_PATH = /Applications/x64.app/Contents/MacOS/x64
VICE_OPTS = +confirmexit -rrbioswrite
DEFAULT_PRG = learning
include c64_kickass.mk
@wontoncc
wontoncc / notification.cpp
Created February 10, 2014 09:28
An executable to popup a balloon tip in notification area on Windows, written in C++.
// To popup a balloon tip in notification area.
//
// Usage:
// notification.exe [title] [content] [timeout]
// * custom icon can be used when named "notify.ico", which should stay
// in the current directory.
//
// How to compile:
// g++ notification.cpp -o notification.exe -lshlwapi
// Passed on mingw(http://nuwen.net/mingw.html).
@steeve
steeve / _readme.md
Last active July 9, 2024 04:49
How to cross compile Go with CGO programs for a different OS/Arch

How to cross compile Go with CGO programs for a different OS/Arch

It is possible to compile Go programs for a different OS, even though go build says otherwise.

You'll need:

@whalliburton
whalliburton / ssh-keys.el
Created July 10, 2013 16:47
While keeping long standing emacs sessions on remote machines nside terminal multiplexers such as 'screen' and 'tmux', the SSH_AUTH_SOCK environment variable of the emacs process becomes stale after disconnection and reconnection. The interactive function SET-SSH-AGENT-SOCKET below allows for a quick and dirty way to automatically reset this var…
;; ssh-keys.el
;; While keeping long standing emacs sessions on remote machines
;; inside terminal multiplexers such as 'screen' and 'tmux', the
;; SSH_AUTH_SOCK environment variable of the emacs process becomes
;; stale after disconnection and reconnection. The interactive
;; function SET-SSH-AGENT-SOCKET below allows for a quick and dirty
;; way to automatically reset this variable to the latest incoming SSH
;; agent authorization socket.
@jackrusher
jackrusher / skewer-coffee.el
Last active December 19, 2017 19:20
The tiniest possible skewer-mode extension for coffeescript support.
;;; skewer-coffee.el --- skewer support for live-interactive Coffeescript
(defun skewer-coffee-eval (coffee-code)
"Requests the browser to evaluate a coffeescipt string."
;; XXX should escape double quote characters
(skewer-eval (concat "CoffeeScript.eval(\""
(s-replace "\n" "\\n" (s-trim coffee-code))
"\");")
#'skewer-post-minibuffer))
@jboner
jboner / latency.txt
Last active July 22, 2024 14:44
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
We couldn’t find that file to show.