Skip to content

Instantly share code, notes, and snippets.

View ch1c0t's full-sized avatar

Anatoly Chernov ch1c0t

View GitHub Profile
@AndrewRadev
AndrewRadev / markdown_open_link.vim
Last active September 29, 2024 20:07
Open a markdown link under the cursor (proof-of-concept)
@AndrewRadev
AndrewRadev / pophelp.vim
Last active September 29, 2024 20:07
Open Vim help in a resizable, movable popup window
" Save as ~/.vim/plugin/pophelp.vim
let s:popup = 0
command! -range=0 -nargs=* -complete=help
\ Pophelp call s:Open(<q-args>, <count>)
command! Popclose call s:Close()
function! s:Open(topic, count) abort
if a:topic == ''
@AndrewRadev
AndrewRadev / netrw_icons.vim
Last active April 26, 2025 16:21
Render icons in netrw
" Save as ~/.vim/ftplugin/netrw_icons.vim
if exists('b:netrw_icons_loaded')
finish
endif
let b:netrw_icons_loaded = 1
autocmd TextChanged <buffer> call s:NetrwAddIcons()
if empty(prop_type_get('netrw_file_icon', {'bufnr': bufnr('%')}))
@Beyarz
Beyarz / README.md
Last active November 8, 2024 21:03
Comprehensive guide to get working environment with MRuby

Getting started

Compile on Windows

  1. Install msys2 (because we need mingw64, gcc and libws2_32.a)
  2. Open msys2 or mingw64 and run pacman -S mingw64/mingw-w64-x86_64-mruby
  3. Get MRuby and extract the folder
  4. Run make inside the folder mruby-3.3.0, there will be a new folder called /build after the compilation, we need the file at /build/host/lib/libmruby.a
  5. Compile using the following command gcc main.c -I"mruby-3.3.0/include" "mruby-3.3.0/build/host/lib/libmruby.a" "C:\msys64\mingw64\lib\libws2_32.a" -lm -o main or substitue "C:\msys64\mingw64\lib\libws2_32.a" with -lws2_32
  6. Run the compiled binary main.exe
@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/
@milushov
milushov / .gitlab-ci.yml
Last active January 9, 2025 17:06
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