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
let arrays = [ [1,2], [2,3], [3,4] ]; | |
let singleArray = [].concat.apply([], arrays); | |
//singleArray = [1, 2, 2, 3, 3, 4]; |
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
# Lambda ARNs | |
aws lambda list-functions | jq '.Functions[].FunctionArn' | |
# multiple properies: outputs on separate lines | |
aws lambda list-functions | jq -r '.Functions[] | .FunctionArn, .FunctionName' | |
# multiple properties as arrays | |
aws lambda list-functions | jq -r '.Functions[] | [.FunctionArn, .FunctionName]' | |
# multiple properties as arrays, converted to csv |
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
# list alll connectors | |
GET connectorhost:8083/connectors | |
# status for one connector | |
GET connectorhost:8083/connectors/connector-name/status | |
# restart - does not restart failed tasks | |
POST connectorhost:8083/connectors/connector-name/restart | |
# restart specific task |
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
#calls a function setting the value for 'this' within the function | |
functionName.call(someThisValue, otherParams); | |
- the first param passed is the value for 'this' when this is referenced within that function | |
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/call |
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
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=8081 -jar YourApp.jar |
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
let example = new Promise( | |
function(resolve, reject){ | |
let success = do some async task; | |
if(success){ | |
resolve(); | |
}else{ | |
reject(); | |
} | |
}; | |
); |
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
- 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
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 |