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
import { CfnOutput } from 'aws-cdk-lib' | |
import * as codebuild from 'aws-cdk-lib/aws-codebuild' | |
import * as codepipeline_actions from 'aws-cdk-lib/aws-codepipeline-actions' | |
import { StackContext } from 'sst/constructs' | |
import { BasePipeline } from './base-pipeline' | |
export interface PipelineStackConfig { | |
readonly bitbucketOwner: string | |
readonly bitbucketRepo: string | |
readonly bitbucketConnectionArn?: string | |
} |
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
/** | |
* “Using Javascript or Typescript, please write runnable code to solve this challenge. | |
You are given an array of integers of arbitrary size. The numbers in the array are in sorted order. | |
The numbers are incremented sequentially by one, somewhere in the sequence there is a missing number. | |
Write code, complete functions, that can parse such an arbitrary size array and return the missing number. | |
number 15 is missing here | |
An example array could be: [-1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 18, 19, 20] |
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
import { Visitor, Program, ImportDeclaration, ExportDeclaration, ModuleItem, ModuleDeclaration } from "@swc/core"; | |
import { parse } from "@swc/core"; | |
import * as path from "path"; | |
import * as fs from "fs"; | |
interface DebarrelPluginOptions { | |
include?: RegExp[]; | |
possibleBarrelFiles?: RegExp[]; | |
} |
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
const baseName = "SOME_CONSTANT_NAME_FOR_THIS" | |
const repository = new Repository(this, `${baseName}Repository`, { | |
repositoryName: snakeCase(`${baseName}Repository`), | |
}); | |
const logGroup = new LogGroup(this, `${baseName}LogGroup`, { | |
retention: 90, | |
logGroupName: '/aws/ecs/graphql-api', | |
}); |
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
QUERY PLAN | | |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | |
Aggregate (cost=6806492.29..6806492.30 rows=1 width=32) (actual time=4573.820..4573.837 rows=1 loops=1) | | |
Output: COALESCE(json_agg(row_to_json((SubPlan 2))), '[]'::json) |
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
module.exports = { | |
// ... | |
resolve: { | |
alias: { | |
'react-router': path.resolve(__dirname, './node_modules/react-router'), | |
}, | |
}, | |
} |
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
#!/usr/bin/node | |
/* eslint-disable @typescript-eslint/no-unused-expressions */ | |
// eslint-disable-next-line import/no-extraneous-dependencies | |
const sh = require('shell-tag'); | |
const detectChangedFiles = () => { | |
const appFolders = ['routes', 'pages', 'modules', 'hooks']; | |
const changedFiles = sh`git diff develop --name-only`; | |
return changedFiles.split(/\n/g).filter((file) => { |
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
/** | |
* 1. Fetch on render - render on useEffect/constructor | |
* 2. Not using a fetch which is suspense ready/has suspense features (swr, react-query, or even a wrapper on top of fetch) | |
* 3. Not using fallback for loading state on wrappers for the request | |
* 4. Error handling > create a custom error boundary to catch problems when we are rendering and while fetching! | |
*/ | |
const fetcher = (url) => fetch(url).then((r) => r.json()); | |
const SuspensefulUserProfile = ({ userId }) => { | |
const { data } = someSuspenseReadyFetcher(userId); |
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
// 1.: | |
module.exports = { | |
entry: './src/index.js' | |
} | |
// index.js | |
fetch = myFetch |
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
{ | |
"jsonstream":[ | |
"examples", | |
"tests" | |
], | |
"agent-base":[ | |
"tests" | |
], | |
"ansicolors":[ |
NewerOlder