We have the same code working using node
, deno
, and bun
.
E.g.,
bun run index.js
# -------------------------------------------------------------- | |
# Customer Support Ticket Classification System | |
# -------------------------------------------------------------- | |
import instructor | |
from pydantic import BaseModel, Field | |
from openai import OpenAI | |
from enum import Enum | |
from typing import List |
/** @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 that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
import foo from 'foo'
instead of const foo = require('foo')
to import the package. You also need to put "type": "module"
in your package.json and more. Follow the below guide.await import(…)
from CommonJS instead of require(…)
.version: '3.7' | |
services: | |
postgres: | |
image: postgres:10.5 | |
restart: always | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
logging: | |
options: |
## 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() |
If you use
create-react-app
, #5136 (released with the 2.0) implements a--use-pnp
option that allows you to easily create a new project using PnP! In this case, just usecreate-react-app --use-pnp
together 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 --version
should give youv1.12.1
or higher. If you don't get this result maybe a
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' |
You may have noticed that when you installed the AWS CLI via pip install awscli
that you got a aws_bash_completer
command added to your path. But, how do you use it?
I'm only going to address the use of Homebrew for Mac because that is how I do things.
Let's assume you have done brew install bash-completion
in a process similar to this. If so, then your ~/.bash_profile
will include something like this: