Skip to content

Instantly share code, notes, and snippets.

View troosh's full-sized avatar

Alexander Troosh troosh

View GitHub Profile
@troosh
troosh / gist:8d5f8ba5fe6bf0917f9153e4c5ded1b0
Created December 28, 2018 17:28
Search all 130+ GiB of source code within Debian
https://codesearch.debian.net/
Удобно для поиска перечня пакетов, где встречается какая-то функции или хидер.
@troosh
troosh / recompress.gz2xz.sh
Created August 16, 2018 19:34
Script to recompressing files from *.gz to *.xz
#!/bin/bash
for f in $(find . -name \*.gz)
do
echo -n "$(dirname "$f")/$(basename "$f" .gz): .gz => .xz ... " && \
gzip -cd "$f" | xz -9 > $(dirname "$f")/$(basename "$f" .gz).xz && \
touch --reference="$f" $(dirname "$f")/$(basename "$f" .gz).xz && \
rm "$f" && \
echo "done"
done
@troosh
troosh / movemask.c
Created January 14, 2018 09:00 — forked from mhroth/movemask.c
A basic NEON implementation of SSE _mm_movemask_ps
uint32_t _mm_movemask_ps(float32x4_t x) {
uint32x4_t mmA = vandq_u32(
vreinterpretq_u32_f32(x), (uint32x4_t) {0x1, 0x2, 0x4, 0x8}); // [0 1 2 3]
uint32x4_t mmB = vextq_u32(mmA, mmA, 2); // [2 3 0 1]
uint32x4_t mmC = vorrq_u32(mmA, mmB); // [0+2 1+3 0+2 1+3]
uint32x4_t mmD = vextq_u32(mmC, mmC, 3); // [1+3 0+2 1+3 0+2]
uint32x4_t mmE = vorrq_u32(mmC, mmD); // [0+1+2+3 ...]
return vgetq_lane_u32(mmE, 0);
}
@troosh
troosh / gist:0bd9f5c26d572fb6b63d
Last active August 17, 2018 09:34
+troosh is my openname
Verifying that +troosh is my openname (Bitcoin username). https://onename.io/troosh