Skip to content

Instantly share code, notes, and snippets.

View ch1c0t's full-sized avatar

Anatoly Chernov ch1c0t

View GitHub Profile
@AndrewRadev
AndrewRadev / textobj_url.vim
Created February 9, 2024 20:48
URL text object
onoremap <silent> iu :<c-u>call <SID>UrlTextObject()<cr>
xnoremap <silent> iu :<c-u>call <SID>UrlTextObject()<cr>
onoremap <silent> au :<c-u>call <SID>UrlTextObject()<cr>
xnoremap <silent> au :<c-u>call <SID>UrlTextObject()<cr>
function! s:UrlTextObject()
let saved_view = winsaveview()
let saved_end_pos = getpos("'b")
defer setpos("'e", saved_end_pos)
@tsangwpx
tsangwpx / apt-srv-debian-docker.md
Last active March 30, 2025 08:46
apt SRV records and debian-based docker image

apt/apt-get commands may use SRV record to find nearby APT service. [1]

However, offical Debian/Ubuntu images cannot utilize such functonality unless /etc/services file is present.

This means APT will download packages from deb.debian.org / archive.ubuntu.com as usual. 🤣

This also means local APT (cache/proxy) servers is bypassed and the build process may be slowed down if the bandwidth is limited.

Workaround

@dector
dector / index.ts
Created August 31, 2023 11:36
Send email from Cloudflare Worker
/*
Also requires DNS setup for domain:
TXT
_mailchannels
v=mc1 cfid=<YOUR_WORKER_DOMAIN_IN_CLOUDFLARE>.workers.dev
Also DKIM:
https://developers.cloudflare.com/pages/platform/functions/plugins/mailchannels/
@pbnj
pbnj / .tmux.conf
Last active December 3, 2025 18:03
Toggle-able Terminal in Tmux
bind-key -n 'C-\' run-shell -b ${HOME}/.local/bin/tmux-toggle-term
@milushov
milushov / .gitlab-ci.yml
Last active September 26, 2025 00:26
Kamal (Ex Mrsk) deploy with Gitlab CI (docker in docker)
services:
- docker:24.0.5-dind
variables:
DOCKER_HOST: tcp://docker:2375
DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "" # don't start over TLS
meta-build-image:
interruptible: true
@armish
armish / ChatGPT function return - annotate genes with HGNC fields.ipynb
Created June 16, 2023 18:09
Use ChatGPT's new function return functionality to enrich an answer with HGNC's most recent annotation for gene-related questions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JBlond
JBlond / episoden.md
Last active January 7, 2025 12:54
Fragezeichen Episoden

Drei Fragezeichen Episoden

Nr. Titel Erscheinung Autor Rating
001 und der Super-Papagei 1979-10-12 Robert Arthur
002 und der Phantomsee 1979-10-13 William Arden
003 und der Karpatenhund 1979-10-14 M. V. Carey
004 und die schwarze Katze 1979-10-15 William Arden
005 und der Fluch des Rubins 1979-10-16 Robert Arthur
006 und der sprechende Totenkopf 1979-10-17 Robert Arthur
@tkapias
tkapias / wtoggle.sh
Last active December 15, 2024 21:01
Toggle or launch a new instance of a window with i3wm on a single screen setup.
#!/usr/bin/env bash
# Example for i3wm exec binding: toggle or run urxvtc in client mode (systemd daemon urxvtd), with setenv to bypass TMUX in my bashrc.
# bindcode $mod+Shift+49 exec --no-startup-id "/home/user/.config/i3/scripts/wtoggle.sh -i -c \\"^URxvt$\\" -n \\"^Terminal\sURxvt$\\" -m \\"urxvtc -title 'Terminal URxvt' -e sh -c 'TMUX=false bash'\\" -s \\"urxvtd\\""
# locale
export LC_ALL="C.UTF-8"
export TZ=:/etc/localtime
Help()
@kawalain
kawalain / ay.sh
Created March 7, 2023 12:07
Viraul Microphone for PulseAudio/PipeWire
pactl load-module module-null-sink sink_name=virtual-speakers channel_map=stereo
pactl load-module module-null-sink media.class=Audio/Source/Virtual sink_name=virtual-microphone channel_map=front-left,front-right
pw-link virtual-speakers:monitor_FL virtual-microphone:input_FL
pw-link virtual-speakers:monitor_FR virtual-microphone:input_FR
# pw-link -i
pw-link virtual-speakers:monitor_FL alsa_output.pci-0000_04_00.6.3.HiFi__hw_Generic_1__sink:playback_FL
pw-link virtual-speakers:monitor_FR alsa_output.pci-0000_04_00.6.3.HiFi__hw_Generic_1__sink:playback_FR
@SteveDaulton
SteveDaulton / record_parts.py
Last active January 2, 2025 03:20
Sequential recording with Audacity with Python.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Record Parts:
=============
A demonstration Python application controlling Audacity to make a
sequence of recordings. There will inevitably be short breaks between
each recording due to the time required to Export, clean up and start