- Open Automator
- Create a new document
- Select Quick Action
- Set “Service receives selected” to
files or foldersinany application - Add a
Run Shell Scriptaction- your default shell should already be selected, otherwise use
/bin/zshfor macOS 10.15 (”Catalina”) or later - older versions of macOS use
/bin/bash
- your default shell should already be selected, otherwise use
- if you're using something else, you probably know what to do 😉
This file contains hidden or 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
| const axios = require('axios').default; | |
| axios.interceptors.request.use(x => { | |
| const headers = { | |
| ...x.headers.common, | |
| ...x.headers[x.method], | |
| ...x.headers | |
| }; |
This file contains hidden or 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
| AWSTemplateFormatVersion: '2010-09-09' | |
| Transform: 'AWS::Serverless-2016-10-31' | |
| Resources: | |
| MyFunction: | |
| Type: AWS::Serverless::Function | |
| Properties: | |
| InlineCode: | | |
| exports.handler = async () => { |
This file contains hidden or 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
| def fg = 30 | |
| def bg = 46 | |
| def style = "${(char)27}[$fg;$bg"+"m" | |
| println(style+"HELLO") | |
| /* | |
| +~~~~~~+~~~~~~+~~~~~~~~~~~+ | |
| | fg | bg | color | | |
| +~~~~~~+~~~~~~+~~~~~~~~~~~+ | |
| | 30 | 40 | black | | |
| | 31 | 41 | red | |
Boto3 documentation for lambda_client.invoke suggests it is possible to pass data via the ClientContext object as a string.
The string is required to be base64 encoded JSON.
To encode such a string, use:
import baseb4
base64.b64encode(b'<string>').decode('utf-8')