Skip to content

Instantly share code, notes, and snippets.

@vladholubiev
vladholubiev / index.ts
Created November 28, 2023 11:19
Raycast extension to rewrite text from clipboard to sound like a native speaker, and copy it back to clipboard.
import { showHUD, Clipboard } from "@raycast/api";
import OpenAI from 'openai';
import dotenv from 'dotenv';
dotenv.config({ path: '~/.zshrc' });
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY ?? '',
});
ddb-parallel-scan (96%) [224/250] [time:196ms] [total (fetched/scanned/table-size):908/34853064/36298819] +3ms
ddb-parallel-scan (96%) [145/250] [time:216ms] [total (fetched/scanned/table-size):920/34854754/36298819] +8ms
ddb-parallel-scan (96%) [210/250] [time:232ms] [total (fetched/scanned/table-size):920/34856457/36298819] +5ms
ddb-parallel-scan (96%) [211/250] [time:223ms] [total (fetched/scanned/table-size):920/34858126/36298819] +3ms
const {parallelScanAsStream} = require('@shelf/dynamodb-parallel-scan');
(async () => {
const stream = await parallelScanAsStream(
{
TableName: 'files',
FilterExpression: 'attribute_exists(#fileSize)',
ExpressionAttributeNames: {
'#fileSize': 'fileSize',
},
const {parallelScan} = require('@shelf/dynamodb-parallel-scan');
(async () => {
const items = await parallelScan(
{
TableName: 'files',
FilterExpression: 'attribute_exists(#fileSize)',
ExpressionAttributeNames: {
'#fileSize': 'fileSize',
},
import {parallelScan} from './src';
(async () => {
console.time('fetch');
const data = await parallelScan(
{
TableName: 'notifications',
FilterExpression: '#updatedAt > :updatedAt and #senderId = :senderId',
ExpressionAttributeNames: {
@vladholubiev
vladholubiev / sls-install.sh
Last active September 15, 2021 09:53
Copy of script behind slss.io/install, but without logic for China region. This helps to avoid timeouts in CI environment, when originals script tries to install from China mirror by mistake.
#!/usr/bin/env bash
#
# Download and install standalone binary.
# The binary version can be specified by setting a VERSION variable.
# e.g. VERSION=2.21.1 bash install.sh
# If VERSION is unspecified it will download the latest version.
set -e
reset="\033[0m"
# usage get_api_key some-name
function get_api_key {
value=$(aws apigateway get-api-keys --query "items[?name=='${1}'].value" --include-values --output text);
echo "${value}";
}
@vladholubiev
vladholubiev / cw-log-groups-without-tags.ts
Created January 5, 2021 16:34
Print log groups w/o tags
import {CloudWatchLogs} from 'aws-sdk';
const cw = new CloudWatchLogs({region: 'us-east-1'});
(async () => {
const results: CloudWatchLogs.LogGroup[] = [];
await getAllLogGroups(results, '');
for (const lg of results) {
# test directories
__tests__
^(?!@serverless/enterprise-plugin/).*test.*$ # fix for serverless-enterprise
tests
powered-test
*.test.js
*.tap.js
*.test.ts
*tests.html
function circl {
open "https://app.circleci.com/pipelines/github/ORG_NAME_HERE/$(basename $PWD)?branch=$(git rev-parse --abbrev-ref HEAD)"
}