This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function git_host_prompt --description "Use nerdfonts to show which Git repo host the origin is on" | |
set -l repo_info (command git rev-parse --git-dir --is-inside-git-dir --is-bare-repository --is-inside-work-tree HEAD 2>/dev/null) | |
test -n "$repo_info" | |
or return | |
set -l git_dir $repo_info[1] | |
set -l inside_gitdir $repo_info[2] | |
set -l bare_repo $repo_info[3] | |
set -l inside_worktree $repo_info[4] | |
set -q repo_info[5] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1. install QuackOSM and DuckDB | |
-- 2. get a city/country pbf from http://download.geofabrik.de/ | |
-- 3. run `quackosm ./greater-london-latest.osm.pbf` and wait | |
-- 4. run `duckdb` and... | |
install spatial; | |
load spatial; | |
select *, | |
tags['name'] as poi_name, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell -i python3 -p python311 python311Packages.pypdf | |
import sys | |
from pypdf import PdfReader | |
def extract_subpdfs(): | |
for filename in sys.argv[1:]: | |
print("Extracting " + filename) | |
root_doc = PdfReader(open(filename, "rb")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require('util') | |
pedal_rules = { | |
l = { | |
{ | |
name = "Google Meet (show chat)", | |
predicate = isAppRunning("Google Chrome"), | |
action = hs.fnutils.partial(dispatchCommandToChrome, {'ctrl', 'cmd'}, 'c'), | |
}, | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# finds all things that have a "follows" or "followed by" relationship, where the thing it follows is a year. | |
# these exist because parsers pulled next/prev links from wikipedia and decided to infer the thing it follows is a year. | |
# action: check and remove | |
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
PREFIX wikibase: <http://wikiba.se/ontology#> | |
PREFIX bd: <http://www.bigdata.com/rdf#> | |
SELECT DISTINCT ?a ?aLabel ?aType ?aTypeLabel ?b ?bLabel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkg="a" | |
include "../shared/base.mk" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<i id="latin-text-1" lang="la" typeof="schema:CreativeWork" about="#latin-text-1" property="schema:text">veni vidi vici</i> | |
(<span typeof="schema:CreativeWork"> | |
<data property="schema:translationOfWork" resource="#latin-text-1" /> | |
<span property="schema:text" lang="en">I came, I saw, I conquered</span> | |
</span>) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Add underlines to keyboard in keybr | |
// @version 1 | |
// @match *://keybr.com/ | |
// @match *://keybr.com/* | |
// @match *://www.keybr.com/ | |
// @match *://www.keybr.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# alias in your zshrc as | |
# alias prj="source ~/bin/_prj" | |
DIR=`cat ~/.emacs.d/.local/cache/projectile.projects | sed 's/" "/\n/g' | sed 's/[\"\(\)]//g' | fzf | xargs -n 1 python -c 'import os, sys; print(os.path.expanduser(sys.argv[1]))'` | |
cd $DIR |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require 'filenotify) | |
(after! projectile | |
(dolist (proj-dir projectile-known-projects) | |
(file-notify-add-watch proj-dir '(change) #'projectile-maybe-invalidate-cache))) |
NewerOlder