Skip to content

Instantly share code, notes, and snippets.

View indigoviolet's full-sized avatar
🐈

Venky Iyer indigoviolet

🐈
View GitHub Profile
@cvcore
cvcore / org-fragment-auto-preview.el
Last active May 30, 2020 18:33
Automatic fragment toggling in org-mode
;;
;; 28.07.2017
;; Charles Wang
;;
;;;;;;; Tweaks for Org & org-latex ;;;;;;
(defvar cw/org-last-fragment nil
"Holds the type and position of last valid fragment we were on. Format: (FRAGMENT_TYPE FRAGMENT_POINT_BEGIN)"
)
@andmarios
andmarios / hc.sh
Created April 14, 2019 23:10
Script to control battery charge and fn lock for Matebook X Pro. Requires vim (xxd), hexdump, dd, ec_sys module and bash.
#!/usr/bin/env bash
help() {
cat <<EOF
Options:
- cc-disable
Disable charging control
- cc-home
Charging control to Home mode (40%-70%)
- cc-work
@arthur-tacca
arthur-tacca / trio_result_capture.py
Last active February 12, 2024 13:31
ResultCapture class for Trio - now adapted into aioresult: https://github.com/arthur-tacca/aioresult
#
# -- An improved version of this code is now in the aioresult library --
#
# https://github.com/arthur-tacca/aioresult
#
#
# - aioresult has a ResultCapture class similar to the one below
# - It also has a Future class that allows manually setting the result, which shares a base class with ResultCapture
# - There is a utility function with a similar effect to StartableResultCapture below (but much simpler)
# - There are utility functions wait_any(), wait_all() and to_channel() (which also work with Future instances)
@aksh-at
aksh-at / jupyter-bore.py
Last active April 5, 2023 13:26
Jupyter on Modal through Bore
# Quick snippet to connect to a Jupyter notebook server running inside a Modal container,
# especially useful for exploring the contents of Modal shared volumes.
# This uses https://github.com/ekzhang/bore to expose the server to the public internet.
#
# Steps
# -----
# 1. (Recommended) Change `JUPYTER_TOKEN` to a different value; default is 1234.
# 2. `modal run jupyter-bore.py`
# 3. Find the `bore.pub` URL printed in the logs, and navigate to it using your browser.