Skip to content

Instantly share code, notes, and snippets.

View ch1c0t's full-sized avatar

Anatoly Chernov ch1c0t

View GitHub Profile
@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/
@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
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 April 2, 2024 10:32
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 April 8, 2024 08:23
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()
@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|

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
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 April 5, 2024 21:22
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() {
@szkrd
szkrd / xiaomi-redmi-4x-unlock.md
Created August 10, 2021 16:32
Xiaomi Redmi 4x unlock, lineage install and root

Unlock Xiaomi Redmi 4X (santoni) and install Lineage OS via sideloading

So far the most useful documentation was at Lineage's Redmi section, random "mobile enthusiast" sites were "not very good" and youtube videos are to be avoided like the plague.

Files needed

  • SDK platform tools from android.com
  • mi flash unlock gui tool (miflash_unlock-en-5.5.224.24.zip)
  • newest twrp for device (twrp-3.5.2_9-0-santoni.img), from twrp site