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
sls invoke local --function functionname | |
NoSuchMethodError: 'void com.amazonaws.services.lambda.runtime.LambdaLogger.log ... | |
Per https://github.com/serverless/serverless/issues/5155 | |
change aws-lambda-java-log4j2 verion in pom.xml to 1.0.0 |
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
Primary keys - 2 types: | |
- Partition key: unique value, internally is hashed to determine which partition item is stored in | |
- Partition and sort key: composite key of an id and an attribute that sorts items by this value | |
- sort key is also called a range attribute | |
- the combination of partition id and sort key must be unique, but partition id can exist for multiple rows | |
- allows storing multiple rows for a specific id, for example: | |
if employeeid = partition key and employee_info = sort key | |
employeeid=1, employee_info=contactinfo |
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
- a module can only have one default export: | |
export default A = //something | |
... and can be imported with any name: | |
import A from './A.js'; | |
import B from './A.js'; | |
import someothername from './A.js' | |
- named exports are imported by their exact name only, a module can have zero, one or more named exports |
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
# diff changed files against previous commit - this doesn't show anything for a first commit | |
git diff-tree --no-commit-id --name-only -r commithash | |
# list all files on a commit | |
git ls-tree --name-only -r commithash | |
# delete a file from all commit history | |
git filter-branch --tree-filter "rm -f filename" HEAD |
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
React fragments https://reactjs.org/docs/fragments.html | |
- group a list of child elements without grouping them wihin a containing parent element in the DOM where that | |
would be invalid. An example is a list of <td> elements rendered by a component. If the parent component renders a <tr>, | |
if the child element wrapped these in a <div> that would be invald HTML structure, but they can be logically grouped | |
as a fragment instead, using <React.Fragrment>, or the <> </> JSX shorthand | |
React Context: https://reactjs.org/docs/context.html | |
- used to automatically pass props down to all child elements without passing the props manually from one child to the next |
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
Fast Forward | |
- when no other changes made to master between the last change and the change you are about to merge on your branch, | |
master is 'fast forwarded' to point to your last commit that you are merging into master (no other changes to merge) | |
Merging a branch | |
- checkout target branch: git checkout targetname | |
- merge source into the target: git merge sourcename |
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
# switch branches | |
git branch branchname | |
# chekout files on branch | |
git checkout branchname | |
# both of the above combined | |
git checkout -b branchname | |
#rename a branch |
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
JAX-RS Jersey Spring RestController | |
------------- --------------------- | |
@Path("/examplepath") @RestController | |
@RequestMapping("/examplepath") | |
@GET("/item") @GetMapping("/item") | |
@Produces(MediaType.APPLICATION_JSON) | |
@QueryParam("id") @RequestParam("id") // e.g. /example?id=123 | |
@PathParam("id") @PathVariable("id") //e.g. /example/{id}/detail |
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
Edit ~/.ssh/config and for each repo add the following block: | |
host hostname-of-repo | |
user your-id-for-this-repo | |
identityfile ~/.ssh/filename-of-key |
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
aws --endpoint-url=http://localhost:4566 dynamodb put-item --table-name exampletable --item '{ | |
"LastName" : { "S" : "test1" } | |
}' \ | |
--return-consumed-capacity TOTAL | |
#query table with only a hash key | |
aws --endpoint-url=http://localhost:4566 dynamodb query --table-name exampletable \ | |
--key-condition-expression "LastName = :v1" \ | |
--expression-attribute-values '{ | |
":v1" : {"S": "test1"} |