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 'request) | |
(setq mb-emacs-app-token "123456789") ;; create this in account -> app tokens -> edit apps | |
(setq mb-micropub-endpoint "https://micro.blog/micropub") | |
(setq mb-destination-address "https://your.micro.blog") | |
(setq mb-image-upload-timeout 20) ;; seconds | |
(defun mb-get-media-endpoint () | |
(cdr (assoc "media-endpoint" | |
(let (result) |
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 | |
# Inspired on https://david-kerwick.github.io/2017-01-04-combining-zsh-history-files/ | |
set -e | |
history1=$1 | |
history2=$2 | |
merged=$3 | |
echo "Merging history files: $history1 + $history2" | |
test ! -f $history1 && echo "File $history1 not found" && exit 1 |
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
from __future__ import absolute_import, print_function, unicode_literals | |
import boto3 | |
def clean_old_lambda_versions(): | |
client = boto3.client('lambda') | |
functions = client.list_functions()['Functions'] | |
for function in functions: | |
versions = client.list_versions_by_function(FunctionName=function['FunctionArn'])['Versions'] | |
for version in versions: |
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/sh | |
# Use AWS CLI to get the most recent version of an AMI that | |
# matches certain criteria. Has obvious uses. Made possible via | |
# --query, --output text, and the fact that RFC3339 datetime | |
# fields are easily sortable. | |
export AWS_DEFAULT_REGION=us-east-1 | |
aws ec2 describe-images \ |