Skip to content

Instantly share code, notes, and snippets.

@kepano
kepano / obsidian-web-clipper.js
Last active October 27, 2025 04:27
Obsidian Web Clipper Bookmarklet to save articles and pages from the web (for Safari, Chrome, Firefox, and mobile browsers)
javascript: Promise.all([import('https://unpkg.com/turndown@6.0.0?module'), import('https://unpkg.com/@tehshrike/readability@0.2.0'), ]).then(async ([{
default: Turndown
}, {
default: Readability
}]) => {
/* Optional vault name */
const vault = "";
/* Optional folder name such as "Clippings/" */
@nobiot
nobiot / new-file-create.el
Created April 25, 2021 21:14
POC for "schema" idea to go with denderoam.el
(defvar my/schema '()
"Collection of categories.")
(setq my/schema (list
"philosophy"
"philosophy.analytic"
"philosophy.analytic.Russel"
"philosophy.classic"
"philosophy.classic.Greek"
"philosophy.classic.Greek.Plato"
(defun vulpea-project-p ()
"Return non-nil if current buffer has any todo entry.
TODO entries marked as done are ignored, meaning the this
function returns nil if current buffer contains only completed
tasks."
(seq-find ; (3)
(lambda (type)
(eq type 'todo))
(org-element-map ; (2)
@gsj987
gsj987 / init-ts.el
Last active December 11, 2024 18:33
Make eglot support tsx
(define-derived-mode typescriptreact-mode web-mode "TypescriptReact"
"A major mode for tsx.")
(use-package typescript-mode
:mode (("\\.ts\\'" . typescript-mode)
("\\.tsx\\'" . typescriptreact-mode)))
(use-package eglot
:ensure t
:defer 3
@tiensonqin
tiensonqin / query
Created September 24, 2020 02:19
Logseq queries example (using properties) and custom view
#+BEGIN_QUERY
{:title [:h2 "Programming languages list"]
:query [:find (pull ?b [*])
:where
[?b :block/properties ?p]
[(get ?p "type") ?t]
[(= "programming_lang" ?t)]]
:view (fn [result]
(when (seq result)
(let [blocks (flatten result)]
@kstrempel
kstrempel / gist:3b2f707c2f9019e55f4721b3a80cfbf2
Last active January 27, 2021 16:01
Running OpenAI with in Clojure and libpython-clj
(ns pyclojure.core
(:gen-class)
(:require [libpython-clj.require :refer [require-python]]
[libpython-clj.python :as py]))
; import gym
; env = gym.make('CartPole-v0')
; for i_episode in range(20):
; observation = env.reset()
; for t in range(100):
@holocronweaver
holocronweaver / straight.el
Created September 1, 2018 20:14
Using straight.el with Prelude: place in your .emacs.d/personal/preload folder
;;; straight --- Use straight.el to manage packages with version control.
;;; Commentary:
;; straight.el allows git to track package versions, ensuring Emacs
;; stability and reversible package upgrades.
;;; Author: holocronweaver
;;; Created: 2018
;;; Code:
(let ((bootstrap-file (concat user-emacs-directory "straight/repos/straight.el/bootstrap.el"))
(bootstrap-version 3))
(unless (file-exists-p bootstrap-file)
@bmaupin
bmaupin / install-old-firefox.sh
Last active December 15, 2022 16:17
Temporarily install old version of Firefox for testing
# Firefox 33 was the last version to support SSLv3 (https://blog.mozilla.org/security/2014/10/14/the-poodle-attack-and-the-end-of-ssl-3-0/)
#firefox_version=33.0
# Firefox 51 was the last version to support NPAPI plugins (e.g. Java) (https://support.mozilla.org/en-US/kb/npapi-plugins)
#firefox_version=51.0
# Firefox 56 was the last version to support XPCOM- and XUL-based add-ons (https://blog.mozilla.org/addons/2016/11/23/add-ons-in-2017/)
#firefox_version=56.0
wget https://ftp.mozilla.org/pub/firefox/releases/$firefox_version/linux-x86_64/en-US/firefox-$firefox_version.tar.bz2
tar -xvf firefox-$firefox_version.tar.bz2
mv firefox firefox-$firefox_version
@itod
itod / split_keyboards.md
Last active September 23, 2025 07:22
Every "split" mechanical keyboard currently being sold that I know of
@jaemskyle
jaemskyle / gist:52a7b9af30a44dcbe020177e5214edcd
Created August 7, 2016 01:47 — forked from simonmichael/gist:1185421
ghc-pkg-clean, ghc-pkg-reset
# unregister broken GHC packages. Run this a few times to resolve dependency rot in installed packages.
# ghc-pkg-clean -f cabal/dev/packages*.conf also works.
function ghc-pkg-clean() {
for p in `ghc-pkg check $* 2>&1 | grep problems | awk '{print $6}' | sed -e 's/:$//'`
do
echo unregistering $p; ghc-pkg $* unregister $p
done
}
# remove all installed GHC/cabal packages, leaving ~/.cabal binaries and docs in place.