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
{ | |
"name": "hello_world", | |
"version": "1.0.0", | |
"description": "hello world sample for NodeJS", | |
"main": "app.js", | |
"repository": "https://github.com/awslabs/aws-sam-cli/tree/develop/samcli/local/init/templates/cookiecutter-aws-sam-hello-nodejs", | |
"author": "SAM CLI", | |
"license": "MIT", | |
"scripts": { | |
"debug": "sam local invoke --template ../template.yaml --event ../events/event.json -d 9229", |
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
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"type": "node", | |
"request": "launch", | |
"name": "Launch via NPM", | |
"runtimeExecutable": "npm", | |
"cwd": "${workspaceFolder}/hello-world", | |
"runtimeArgs": [ |
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 enhance = compose( | |
flattenProp('user'), | |
renameProp('username', 'name') | |
); | |
// Combine HOC's (from Recompose or custom) with compose | |
const EnhancedProfile = enhance(Profile); |
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 Profile = ({ name }) => ( | |
<div> | |
<div>Name: {name}</div> | |
</div> | |
); | |
Profile.propTypes = { | |
name: string | |
}; | |
const ProfileWithRenamedUsername = renameProp('username', 'name')(Profile); |
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 Profile = ({ username, age }) => ( | |
<div> | |
<div>Username: {username}</div> | |
<div>Age; {age}</div> | |
</div> | |
); | |
Profile.propTypes = { | |
username: string, | |
age: number | |
}; |
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 withClassName = Component => props => ( | |
<Component {...props} className="my-class" /> | |
); |
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 HoC = Component => EnhancedComponent; |
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
Object shares = getValueFromField("SHARES"); | |
Shares = shares?.ToString(); |
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
Object shares = getValueFromField("SHARES"); | |
Shares = (string)shares; |
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
foreach (var salesRep in salesReps) | |
{ | |
var summary = new SalesSummary { SalesRep = salesRep }; | |
var repTransactions = transactions.Where(x => x.SalesRep == salesRep); | |
summary.Y2DSold = repTransactions.Where(x => x.Date >= new DateTime(dateTimeNow.Year, 1, 1)) | |
.Select(x => CalculateTransaction(x)) |
NewerOlder