tmuxa() { tmux a -t $1 }
View immutable.functions.js
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
// Example using Objects.assign | |
const changeName = (user, newName) => Object.assign({}, user, { | |
name: newName | |
}) | |
// Example using destructuring assignment | |
const changeName = (user, newName) => ({ | |
...user, | |
name: newName, | |
}) |
View immutable.js
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 user = { | |
name: 'John Due', | |
birthdate: '1988-08-15', | |
} | |
const changeName = (user, newName) => { | |
return { | |
...user, // destructuring user object | |
name: newName, // override name attribute with new name | |
} |
View mutable.js
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 user = { | |
name: 'John Due', | |
birthdate: '1988-08-15', | |
} | |
const changeName = (user, newName) => { | |
const newUser = user | |
newUser.name = newName | |
return newUser | |
} |
View object.assign.js
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
// Example using Objects.assign | |
const deposit = (account, value) => Object.assign({}, account, { | |
balance: account.balance + value | |
}) |
View object.destructuring.js
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
// Example using destructuring assignment | |
const deposit = (account, value) => ({ | |
...account, | |
balance: account.balance + value, | |
}) |
View deposit.js
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 account = { | |
balance: 1000, | |
bank: '', | |
number: '', | |
} | |
const deposit = (account, value) => { | |
const newAccount = account | |
newAccount.balance = account.balance + value | |
return newAccount |
View deposit.js
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 account = { | |
balance: 1000, | |
bank: '', | |
number: '', | |
} | |
const deposit = (account, value) => { | |
return { | |
...account, | |
balance: account.balance + value, |
View avatar.css
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
.avatar-size { | |
max-width: 70px; | |
max-height: 70px; | |
height: 70px; | |
width: auto; | |
object-fit: cover; | |
} |
View tmuxa.md
View git-alias.md
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global color.ui auto
NewerOlder