Skip to content

Instantly share code, notes, and snippets.

View amygrinn's full-sized avatar

Amy Grinn amygrinn

  • 00:58 (UTC -04:00)
View GitHub Profile
@amygrinn
amygrinn / find-similar-file.el
Last active May 21, 2022 19:02
Find similar file by replacing path tokens with minibuffer text
(require 'cl-lib)
(setq find-similar-file-separators '("-" "_" "/" "."))
(defvar find-similar-file--cur-file nil)
(defun find-similar-file-zip (separators tokens)
(let ((seps (cl-copy-list separators)))
(mapconcat
(lambda (token) (concat (pop seps) token))
@amygrinn
amygrinn / init.el
Last active October 24, 2021 16:15
[Move and] capture from gnus to org
;; With point on an email in summary or article view, use '\'
;; (backslash) to move that email to a new group and capture it to org.
;; Uses `gnus-capture-template' instead of `org-capture-templates'.
;; To capture without moving, use 'C-c c'.
(require 'ol)
(require 'ol-gnus)
(require 'org-capture)
;; Set a ist of capture templates to use for gnus
@amygrinn
amygrinn / notify-send
Last active October 24, 2021 14:35
Libnotify shim for termux
#!/bin/bash
# This is a shim for libnotify on termux.
# Calls termux-notification with translated arguments from notify-send
ARGS=""
POSITIONAL=()
while [[ $# -gt 0 ]]; do
case "$1" in
-i|--icon)
@amygrinn
amygrinn / is-plural.el
Last active September 28, 2021 18:34
(require 'ispell)
(defun is-plural (noun)
"Determine if any word in NOUN has a base (root) word.
Uses either ispell, aspell, or hunspell based on user settings."
(condition-case err
(progn
(ispell-set-spellchecker-params)
(let* ((words (split-string noun))
@amygrinn
amygrinn / settings.org
Last active March 24, 2021 20:47
Literate configuration columns view

About

Use column view (C-c C-x C-c) to edit the settings file. Once done, use org-babel-tangle (C-c C-v t) to install to you init file. You can quit column view by putting point in any cell and pressing ‘q’

The machine name can be retrieved by running eval-expression (M-:) and calling (system-name). You can also set the system name using the

@amygrinn
amygrinn / .emacs
Last active December 27, 2023 21:33
Autoshare -> Tasker -> Termux -> Org Protocol -> Org Capture
;; Required setup for emacs init file
(package-initialize)
(require 'org)
(require 'org-protocol)
;; Set 'my-org-directory' to the base directory of all of
;; your org files (with a trailing slash). For me it's:
(setq my-org-directory "/scp:org:/home/orgmode/")
;; But it could be a local directory for you
/**
* Tyler J Grinn
* tylergrinn@gmail.com
* License: MIT
*/
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = class HtmlWebpackExcludeAssetsPlugin {
static PLUGIN_NAME = 'Html webpack exclude assets plugin';
/**
* Tyler J Grinn
* tylergrinn@gmail.com
* License: MIT
*/
const HtmlWebpackPlugin = require('html-webpack-plugin');
const { JSDOM } = require('jsdom');
/**
* Remove all tags from your html webpack template which have an attribute named `dev`
@amygrinn
amygrinn / webpack.config.example.js
Last active September 27, 2020 17:00
Webpack write to file
/** @type {import('webpack').Configuration} */
/**
* Write the version of the package to a file named 'latest'
* When uploaded to a server with multiple versions, you can
* get the name of the latest by running `curl https://<server>/latest`
*/
const WritePlugin = require('./build-tools/write-webpack-plugin');
const { version } = require('./package.json');
@amygrinn
amygrinn / create-random-chalk-theme.ts
Last active September 24, 2020 15:37
Create a random theme with chalk: https://www.npmjs.com/package/chalk
import chalk, { Chalk } from 'chalk';
const modifiers: (keyof Chalk)[] = [
'bold',
'dim',
'italic',
'underline',
'inverse',
];