Skip to content

Instantly share code, notes, and snippets.

View FrostyX's full-sized avatar

Jakub Kadlčík FrostyX

View GitHub Profile
@e7d
e7d / remove-obsolete-gpg-key-from-dnf.md
Last active April 19, 2025 04:37
Remove obsolete GPG key from DNF (Fedora)
@viiru-
viiru- / viiru-ement-tracking.el
Last active November 18, 2023 10:13
Ement tracking.el integration
(cl-defun viiru/ement-notify-track (event room session &key (buffer-name "*Ement Notifications*"))
(with-demoted-errors "viiru/ement-notify-track-if-buffer: %S"
(when (ement-notify--event-message-p event room session)
(let ((buffer (if (ement-notify--room-buffer-live-p event room session)
(map-elt (ement-room-local room) 'buffer)
(when (ement-notify--room-unread-p event room session)
(get-buffer buffer-name))))
(faces (if (ement-notify--room-unread-p event room session)
'(ement-room-list-direct)
'(default))))
@rougier
rougier / nano-minibuffer.el
Created March 25, 2022 09:54
Minibuffer frame for Nano Emacs
;; Nicolas .P Rougier emacs configuration - mini-frame configuration
;; ---------------------------------------------------------------------
(require 'vertico)
(require 'marginalia)
(require 'mini-frame)
(defun minibuffer-setup ()
;; This prevents the header line to spill over second line
(let ((inhibit-message t))
# Delete local tags that have not yete been pushed
git fetch --prune origin "+refs/tags/*:refs/tags/*"
@blackcater
blackcater / diagrams.md
Created July 6, 2018 16:45
Markdown Diagrams

Diagrams

Markdown Preview Enhanced supports rendering flow charts, sequence diagrams, mermaid, PlantUML, WaveDrom, GraphViz, Vega & Vega-lite, Ditaa diagrams. You can also render TikZ, Python Matplotlib, Plotly and all sorts of other graphs and diagrams by using Code Chunk.

Please note that some diagrams don't work well with file exports such as PDF, pandoc, etc.

Flow Charts

This feature is powered by flowchart.js.

@jasco
jasco / README.md
Last active April 18, 2024 18:07
Workaround for SqlAlchemy Alembic Migrations

Dialect specific migration with Alembic

DDL

Certain SQL dialect specific SQL including triggers and stored procedures are not abstracted away by SqlAlchemy. In those cases SqlAlchemy provides a DDL interface that can be connected to events that conditionally trigger the appropriate dialect specific code.

ddl = sqlalchemy.DDL(custom_pg_trigger)

@mitkot
mitkot / gist:bbfe1e5141144780a467fb08994b8352
Created November 2, 2016 09:19
How to extract source files out of src.rpm file
$ rpm2cpio ../hoge.src.rpm | cpio -i
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@gl-sergei
gl-sergei / inbox.el
Last active December 21, 2022 21:38
Display number of unread messages in Emacs modeline (with mu and mu4e)
;;; inbox.el --- display inbox status information -*- coding: utf-8 -*-
;; Copyright (C) 2014 Sergei Glushchenko.
;; Author: Sergei Glushchenko <[email protected]>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
@kachayev
kachayev / dijkstra.py
Last active March 4, 2025 23:42
Dijkstra shortest path algorithm based on python heapq heap implementation
from collections import defaultdict
from heapq import *
def dijkstra(edges, f, t):
g = defaultdict(list)
for l,r,c in edges:
g[l].append((c,r))
q, seen, mins = [(0,f,())], set(), {f: 0}
while q: