Skip to content

Instantly share code, notes, and snippets.

@benevidesh
benevidesh / zn
Last active March 12, 2024 16:10
Zettelkasten Workflow (WIP)
#!/usr/bin/bash
# zn - as zettell
# new export variables EDITOR for your editor and
#+ NOTES for your notes folder.
main () {
note_id=$(date +'%Y%m%d%H%M%S')
$EDITOR $NOTES/"$note_id".md
}
@simonbs
simonbs / Tour de France Profile.js
Created July 13, 2021 14:37
Scriptable script showing a profile of the current Tour de France stage
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: yellow; icon-glyph: bicycle;
let stages = await loadStages()
let stage = findStage(stages)
if (stage == null) {
let widget = createTournamentOverWidget()
await widget.presentMedium()
} else {
let stageDetails = await loadStageDetails(stage.id)
@ttscoff
ttscoff / mmdtagstomacos.rb
Last active May 18, 2021 01:51
Read MultiMarkdown metadata tags from files and apply them as macOS tags
#!/usr/bin/env ruby
# encoding: utf-8
#
# Read MultiMarkdown metadata tags from files and apply them as macOS tags
#
# Usage:
# mmdtagstomacos.rb *.md
require 'shellwords'
mmd = '/usr/local/bin/multimarkdown'
@ColdGrub1384
ColdGrub1384 / install_ipython.py
Last active June 2, 2020 02:51
Install IPython on Pyto (11.1.12+)
"""
Installs IPython on Pyto.
Usage: Usage: import requests as r; exec(r.get('https://bit.ly/35iSbM1').content.decode())
"""
from pip import main as pip
import os.path
docs = os.path.expanduser("~/Documents")
@ColdGrub1384
ColdGrub1384 / Theme.py
Last active June 28, 2020 03:55
Import and export Pyto themes
"""
A script for importing and exporting Pyto themes.
"""
from rubicon.objc import ObjCClass, at
from console import clear
import sys
import base64
import sharing
@cb109
cb109 / vscode_python_sort_imports_isort_on_save.md
Last active April 24, 2025 11:49
VSCode: Python Sort Imports on File Save (isort)

VSCode: Python Sort Imports on File Save (isort)

  • Make sure the isort extension is installed in VSCode

Update April 2025

The latest VSCode update brought the requirement to use a python environment 3.8+ for isort:

2025-04-24 13:28:29.888 [info] No interpreter found from setting isort.interpreter

This has been replaced by a gem

Use gem install bunchcli to install, then run bunch -h for a list of commands.

@ttscoff
ttscoff / sizes.rb
Last active July 12, 2021 03:33
sizes: Calculate and sort all filesizes for current folder
#!/usr/bin/env ruby
# Sizes - Calculate and sort all filesizes for current folder Includes
# directory sizes, colorized output Brett Terpstra 2019 WTF License
VERSION = "1.0.1"
require 'shellwords'
# Just including term-ansicolor by @flori and avoiding all the
# rigamarole of requiring multiple files when it's not a gem... - Brett
#
set ignorecase
set smartcase
set scrolloff=3 " 3 lines above/below cursor when scrolling
" Emulated Plugins
set surround
" set easymotion
set NERDTree
" Copy to system clipboard as well
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 27, 2025 09:14
set -e, -u, -o, -x pipefail explanation