Install these two plugins:
This file contains hidden or 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
// Write a sum function | |
// sum(1)(2)(3)(4)() | |
// Logs 10 | |
function currySum(n, acc = 0) { | |
function createClosure(acc) { | |
return (m) => currySum(m, acc); | |
} |
This file contains hidden or 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
// Write a sum function | |
// sum(1)(2)(3)(4)() | |
// Logs 10 | |
function currySum(n, acc) { // n = 3 | |
if (!n) { | |
return acc; | |
} else { |
This file contains hidden or 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 queryKeys = { | |
completedTodos: "completed-todos", | |
openTodos: "open-todos" | |
} | |
function TodoApp(){ | |
const [selectedTodo, ] = React.useState({/...}) | |
function markAsComplete(todo){ |
This file contains hidden or 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
#Adding environment variables from Local to Heroku | |
1. Running command one by one | |
``` | |
$ heroku config:set DATABASE_URI=database_uri_here | |
$ heroku config:set SESSION_SECRET=session_secret | |
... and so on for each variable, | |
``` | |
2. Reading the environment variable from a .env file |
- Convert the original file
bq_credentials.json
in to a Base64 String.$ openssl base64 -in bq_credentials.json -out bq_credentials.bin
- Copy the string from the file
bq_credentials.bin
- Save this string in a environment variable with the name
GOOGLE_AUTH_KEY
- In the NodeJS application a function should be written to parse the string saved in the
GOOGLE_AUTH_KEY
variable to string. Below is a sample function:
NewerOlder