- 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 😉
| # -------------------------------------------------------------- | |
| # Customer Support Ticket Classification System | |
| # -------------------------------------------------------------- | |
| import instructor | |
| from pydantic import BaseModel, Field | |
| from openai import OpenAI | |
| from enum import Enum | |
| from typing import List |
| # https://hub.docker.com/_/postgres | |
| # Usage: | |
| # $ docker compose up | |
| # NOTE: version not required as of compose spec v | |
| # version: '3.7' | |
| # docker run --name basic-postgres --rm \ | |
| # -e POSTGRES_USER=postgres \ |
If you use
create-react-app, #5136 (released with the 2.0) implements a--use-pnpoption that allows you to easily create a new project using PnP! In this case, just usecreate-react-app --use-pnptogether with Yarn 1.12, and you're good to go! 👍
Plug'n'Play is a new initiative from Yarn that aims to remove the need for node_modules. It's already available, and has proved being effective even on large-scale infrastructures. This document describes in a few steps how to quickly get started with it. Spoiler alert: it's quite easy 🙂
First, download a package manager that supports it. Yarn 1.12 already does, so that's what we're going to use! To install it, just follow the instructions on our website: https://yarnpkg.com/en/docs/install
If everything is ok, running
yarn --versionshould give youv1.12.1or higher. If you don't get this result maybe a
| /** @OnlyCurrentDoc */ | |
| const startDate = new Date("2021-06-16") | |
| // so the first one is D2:K2 | |
| function MarkEmptyCellsInYesterdayRowWithHyphen() { | |
| const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("Group 2 - B"); | |
| // Activates the sheet | |
| SpreadsheetApp.setActiveSheet(sheet); | |
| const today = new Date() |
The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'instead ofconst foo = require('foo')to import the package. Follow the below guide. - If the package is used in an async context, you could use
await import(…)from CommonJS instead ofrequire(…). - Stay on the existing version of the package until you can move to ESM.
| import boto3 | |
| import datetime | |
| import json | |
| from requests_aws4auth import AWS4Auth | |
| import requests | |
| boto3.setup_default_session(region_name='us-east-1') | |
| identity = boto3.client('cognito-identity', region_name='us-east-1') | |
| account_id='XXXXXXXXXXXXXXX' |
| ## Connect PG8000 to database | |
| conn = pg8000.connect(database=args['db_name'],user=args['db_user'],password=args['db_password'],host=args['db_host'],port=5432) | |
| cur = conn.cursor() | |
| # ... | |
| # Example upsert query | |
| cur.execute("INSERT INTO {} SELECT * FROM {} ON CONFLICT (id) DO UPDATE SET name = EXCLUDED.name".format('campaigns', 'tmp_staging_campaings')) | |
| # ... | |
| conn.commit() | |
| cur.close() | |
| conn.close() |
| <iframe src="data:text/html;charset=utf-8,%3Cbody%3E%3Cscript%20src%3D%22https%3A%2F%2Fgist.github.com%2Fef4%2Ffe2e8e5b6e75266e3c2d.js%22%3E%3C%2Fscript%3E%3C%2Fbody%3E"> |