Skip to content

Instantly share code, notes, and snippets.

// func GetCpuForThread() uint64
TEXT ·GetCpuForThread(SB),7,$0
MOVQ $0xB,AX
XORQ CX,CX
CPUID
MOVQ DX,ret+0(FP)
RET
@miku
miku / .gitignore
Created July 23, 2021 16:03 — forked from tkf/.gitignore
A script to locate libpython associated with the given Python executable.
*.pyc
.pytest_cache
@miku
miku / 945526.945527.pdf
Last active January 11, 2026 16:12
Dijkstra 1965 (Go)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@miku
miku / .gitignore
Last active January 17, 2022 23:30
Lightning talk, Notes on Storage
golangleipzig.cdx
golangleipzig.warc.gz
@miku
miku / .gitignore
Last active February 17, 2023 09:55
A data deduplication example with Go
Extra.md
@miku
miku / disassembler.go
Created December 15, 2020 16:36 — forked from grantseltzer/disassembler.go
Full disassembler
package main
import (
"debug/elf"
"fmt"
"log"
"os"
"github.com/bnagy/gapstone"
)
@miku
miku / makecomb.py
Created December 14, 2020 22:17
Generate combinations from a list
#!/usr/bin/env python
"""
Turn:
a
b
c
into:
@miku
miku / makecomb.py
Last active November 25, 2020 10:40
combinations for the command line
#!/usr/bin/env python
import fileinput
import itertools
vs = set()
for line in fileinput.input():
line = line.strip()
if not line:
continue
vs.add(line)
@miku
miku / py2.py
Created August 18, 2020 19:27
Metaclass syntax Python 2 and 3
class A:
pass
class B(metaclass=A):
pass
@miku
miku / gist:9d32607dc394949e5f56bf2066562c79
Created August 15, 2020 16:41 — forked from fnielsen/gist:3904327
Python shelve concurrency
import shelve
import multiprocessing
import os
filename = "tmp.shelve"
N = 4
end = 10000
def insert((offset, jump, end, filename)):