Skip to content

Instantly share code, notes, and snippets.

@ptek
ptek / fzy-key-bindings.zsh
Last active May 8, 2020 11:28
(ZSH) Bind CTRL-R to search using fzy
# Key bindings
# ------------
if [[ $- == *i* ]]; then
# CTRL-R - Paste the selected command from history into the command line
fzy-history-widget() {
local selected num
setopt localoptions noglobsubst noposixbuiltins pipefail 2> /dev/null
selected=( $(fc -rl 1 | fzy) )
local ret=$?

Keybase proof

I hereby claim:

  • I am ptek on github.
  • I am pavlo (https://keybase.io/pavlo) on keybase.
  • I have a public key ASAQ1KgPTxmSRQtNOc6mFwybdk8EKdpVXGKbwzrqxShpwgo

To claim this, I am signing this object:

@ptek
ptek / ghc and hello world debian 7.sh
Created October 21, 2017 10:06
ghc and hello world linux vs macOS - benchmarking the run times
ptek ~/hello> bench .stack-work/install/x86_64-linux/*/*/bin/hello
benchmarking bench/.stack-work/install/x86_64-linux/ghc-7.10.3/7.10.3/bin/hello
time 1.099 ms (1.092 ms .. 1.107 ms)
1.000 R² (0.999 R² .. 1.000 R²)
mean 1.106 ms (1.100 ms .. 1.112 ms)
std dev 20.16 μs (15.32 μs .. 29.03 μs)
benchmarking bench/.stack-work/install/x86_64-linux/ghc-8.0.2/8.0.2/bin/hello
time 1.001 ms (994.6 μs .. 1.008 ms)
0.999 R² (0.998 R² .. 1.000 R²)
@ptek
ptek / gist:08cd53ac1b74e4da1168acd1337932c7
Created December 23, 2016 17:00
Voidlinux fails to unpack runit-void-20160826
core@code ~ $ sudo rkt run --interactive --net=host --dns=host --inherit-env docker://voidlinux/voidlinux --exec=/bin/bash
bash-4.3# xbps-install -Syu
[*] Updating `http://repo.voidlinux.eu/current/x86_64-repodata' ...
x86_64-repodata: 1202KB [avg rate: 8210MB/s]
Name Action Version New version Download size
libcrypto38 install - 2.4.4_1 586KB
libssl39 install - 2.4.4_1 114KB
libxbps update 0.49_4 0.51_14 102KB
xbps update 0.49_4 0.51_14 79KB
@ptek
ptek / voidlinux-container-install-python
Last active December 21, 2016 15:38
Trying to install python in the voidlinux docker container
ptek@notebook:~$ docker run -ti --rm voidlinux/voidlinux /bin/dash
# xbps-install -Sy python
[*] Updating `http://repo.voidlinux.eu/current/x86_64-repodata' ...
x86_64-repodata: 1200KB [avg rate: 4996KB/s]
bash-4.3.042_3: broken, unresolvable shlib `libreadline.so.6'
gawk-4.1.3_6: broken, unresolvable shlib `libreadline.so.6'
sqlite-3.9.2_1: broken, unresolvable shlib `libreadline.so.6'
xfsprogs-4.2.0_1: broken, unresolvable shlib `libreadline.so.6'
Transaction aborted due to unresolved shlibs.
# ls -la /usr/lib/libreadline*
@ptek
ptek / Mixxx 1.8.2 OS X FLAC Error
Created December 12, 2010 01:57
An error opening a FLAC file in Mixxx on OS X 10.6.5
Debug: [Main]: sndfile::ParseHeader: libsndfile error: File contains data in an unimplemented format.
Warning: []: libsndfile: Error opening file "/Users/pavlo/Music/Sept et Lartizan/FLAC/LZO Records - Le Jeu Du Pendu - 02 Les lois de la gravité.flac" File contains data in an unimplemented format.