Skip to content

Instantly share code, notes, and snippets.

@rmchale
rmchale / draftist_extension.js
Last active January 20, 2025 18:40
An extension to draftist to quick add tasks to a specific project
/**
* Ryan_quickAddLines - This action creates a new task for each line in the currently open Draft.
*
* @param {String} text the text which lines should be added as tasks to Todoist
* @param {String} project the project to add the task
* @return {Boolean|Number} false when adding fails, task number when adding succeeded
*/
function Ryan_quickAddLines(text, project = null) {
let todoist = new Todoist()
let lines = text.split("\n");
@rmchale
rmchale / mkver.conf
Created January 8, 2022 17:40
mkver.conf for main
# prefix for tags in git
tagPrefix: v
# defaults are used if they are not overriden by a branch config
defaults {
# whether to really tag the branch when `git mkver tag` is called
tag: false
# message for annotated version tags in git
tagMessageFormat: "release {Tag}"
# format tring for the pre-release. The format must end with {PreReleaseNumber} if it is used.
# Examples:
@rmchale
rmchale / Makefile
Last active December 1, 2021 18:40
Makefile template borrowed from MIke Small
.PHONY: clean init plan apply format lint validate
## hello
hello:
@echo "hello world"
# https://stackoverflow.com/a/25668869
# https://stackoverflow.com/a/19107231
ifeq (, $(shell which fzf))
# simple, brief make rules help generated from comments in Makefile.
@rmchale
rmchale / Makefile
Last active August 28, 2021 18:02
My makefile template
SHELL := /bin/bash
.DEFAULT_GOAL := help
hello: ## hello
@echo "hello world"
help:
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@rmchale
rmchale / Dockerfile
Created May 24, 2020 15:22
Gcloud Dockerfile
from debian:stable
# install gcloud
RUN apt-get install -y lsb-release
RUN apt-get install -y gnupg2
RUN echo "deb http://packages.cloud.google.com/apt cloud-sdk-$(lsb_release -c -s) main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
# RUN cat /etc/apt/sources.list.d/google-cloud-sdk.list
RUN apt-get update && apt-get install -y google-cloud-sdk
<html>
Test
<table class="mdl-data-table mdl-js-data-table mdl-data-table--selectable mdl-shadow--2dp">
<thead>
<tr>
<th class="mdl-data-table__cell--non-numeric">Material</th>
<th>Quantity</th>
<th>Unit price</th>
</tr>
</thead>
@rmchale
rmchale / apps.yml
Last active April 11, 2020 02:10
ChromeOS application setup
---
- name: Pixel slate apps
hosts: localhost
become: yes
tasks:
- shell: lsb_release -cs
register: release
import boto3
dynamodb = boto3.client('dynamodb', region_name='us-east-2')
dynamodb.put_item(TableName='emails',
Item={
'id': {'S': '[email protected]'}
}
)
@rmchale
rmchale / gcedown.sh
Created November 26, 2019 20:44
gcedown
for i in `gcloud compute instances list --project=rmchale-1093 |grep -i mchale |grep RUNNING |awk '{ print $1 }'`
do
zone=$(gcloud compute instances list --project=rmchale-1093 |grep -i $i |awk '{ print $2 }')
yes Y | gcloud compute instances delete $i --zone=$zone --project=rmchale-1093
done
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-deployment
spec:
selector:
matchLabels:
run: hello
replicas: 1
template: