Skip to content

Instantly share code, notes, and snippets.

View ch1c0t's full-sized avatar

Anatoly Chernov ch1c0t

View GitHub Profile
@SteveDaulton
SteveDaulton / pipeclient.py
Last active January 2, 2025 03:17
pipeclient.py is a Python module for sending commands to Audacity from Python. This version is more recent than Audacity's version.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Automate Audacity via mod-script-pipe.
Pipe Client may be used as a command-line script to send commands to
Audacity via the mod-script-pipe interface, or loaded as a module.
Requires Python 3.
(Python 2.7 is now obsolete, so no longer supported)
@asterite
asterite / dependency_sets.cr
Created January 4, 2023 18:01
Compute dependency sets
def affected_files(file, dependencies)
tracked_files = Set(String).new
track(file, dependencies, tracked_files)
tracked_files
end
def track(file, dependencies, tracked_files)
return unless tracked_files.add?(file)
dependencies[file].each do |to|
@LintaoAmons
LintaoAmons / .tmux.conf
Created October 8, 2022 09:50
Popup terminal with tmux
# ... your other config
bind-key -n M-3 run-shell 'toggle-tmux-popup'
# you can switch `M-3` to any keybindings you like.
@columbarius
columbarius / debug-pipewire-screencast.sh
Last active October 12, 2025 19:45
PipeWire Screencast Info
#!/bin/sh
pw-dump | jq -r '[.[] | select(.info.props."node.name" | IN("firefox","gnome-shell","kwin_wayland","obs","xdg-desktop-portal-wlr","xdp-screencast.py")) | .id] as $pw_node_ids | [ .[] | select(.info.props."node.id" | IN($pw_node_ids[])) | .id ] as $pw_port_ids | .[] | select(.id | IN(($pw_node_ids + $pw_port_ids)[]))'

Welcome to the New Era of Scientific Publishing

— by Tobias Kuhn, 4 April 2022; reporting on work with Cristina Bucur, Davide Ceolin, and Jacco van Ossenbruggen [1,2] —

I believe we have made the first steps venturing into a new era of scientific publishing. Let me explain. [Update: At what point exactly a new era begins and what counts as first steps are of course subject to debate. I therefore added a section on related initiatives and further reading below.]

Science is nowadays communicated in a digital manner through the internet. We essentially have a kind of "scientific knowledge cloud", where researchers with the help of publishers upload their latest findings in the form of scientific articles, and where everybody who is interested can access and retrieve these findings. (This is in fact only true for articles that are published as Open Access, but that is not the point here.)

@cisert
cisert / highlight_atoms_3d.py
Created February 9, 2022 10:48
Draw 3D molecule with highlighted atoms
import py3Dmol
from rdkit import Chem
def draw_mol_with_highlights(mol, hit_ats, style=None):
"""Draw molecule in 3D with highlighted atoms.
Parameters
----------
mol : RDKit molecule
hit_ats : tuple of tuples
@nerdinand
nerdinand / Dockerfile
Created January 29, 2022 22:32
Podman setup for Rails 7 (without compose or database)
FROM ruby:3.1
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN bundle install
@4abhinavjain
4abhinavjain / reinstall_VPS_from_inside.txt
Last active November 2, 2025 14:33 — forked from ClashTheBunny/reinstall_VPS_from_inside.sh
DIY install debian on Oracle Cloud Infrastructure ( Free Tier ) - ARM64
# should works on any cloud-init enabled hypervisor (openstack.. )
# start from a normal ubuntu 20.04 install as minimal was not available for ARM64
# Since ARM64 machines has higher RAM, Shrinking is desired but not necessary. Instead we will increase tmpfs to 1700MB
# Getting root (if sudo -i doesn't work then set a root password beforehand using 'sudo passwd root'
sudo -i
# make sure we are on the highest kernel, so we can delete all the others ...
require "benchmark"
module Parser(T)
def self.char(a : Char)
CharParser.new(a)
end
def self.int
IntParser.new
end
@mattmc3
mattmc3 / optparsing_demo.zsh
Last active December 2, 2025 17:37
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {