A problem usually includes issues
and many small issues
(I call sub-issues
) in it. So the effective way to resolve the problem is resolving sub-issues
. It's very difficult to resolve a big problem. We need to divide that problem into many small pieces.
Template
Every morning, I usually take time to write down the issues
that I'd like to resolve and analyze.
I have been using the issues template below that I thought it helps me a lot.
This is my template:
/**
* Issue:
* 🤬sub-issue:
* 🤬sub-issue:
* 🤬sub-issue:
*/
/**
* Sky(sub-issue):
*
* Rain(I have to consider):
* 👉
* Umbrella(I’m going to do):
* ✌️
* ✌️
* ✌️
* 👉
* Umbrella(I’m going to do):
* ✌️
* ✌️
* ✌️
* 👉
* Umbrella(I’m going to do):
* ✌️
* ✌️
* ✌️
* Why-What-How-Where
*
* ✌️Why A?
* ✌️Why B?
* ✌️Why C?
*/
- With each
issue
I have threesub-issue
. - With each
sub-issue
I'm going to create three things that I have to consider(Rain
). - With each
Rain
I have to analyze and create things to do specifically.
My problem
The matter that I really felt annoyed about was every morning, I have to find the template, copy it, and paste it in Quokka that I'm using in Visual Studio Code. It takes tons of time.
So I decided I'm going to make an npm package
that helps me removing the annoying above. I called mainichi-issues
.
mainichi-issues
helps me generate the issues template automatically way. I only need to type the number of issues I'd like to have, it will generate the template and copy it to the clipboard for me.
Coding
I have issue template
:
const ISSUE_TEMPLATE = `
/**
* Issue: TODO
* 🤬sub-issue:
* 🤬sub-issue:
* 🤬sub-issue:
*/
sub-issues template
:
const SUB_ISSUE_TEMPLATE = `
/**
* Sky(sub-issue):
*
* Rain(I have to consider):
* 👉
* Umbrella(I’m going to do):
* ✌️
* ✌️
* ✌️
* 👉
* Umbrella(I’m going to do):
* ✌️
* ✌️
* ✌️
* 👉
* Umbrella(I’m going to do):
* ✌️
* ✌️
* ✌️
* Why-What-How-Where
*
* ✌️Why A?
* ✌️Why B?
* ✌️Why C?
*/
`
I also do need to create a function to copy to the clipboard.
function pbcopy(data) {
const proc = require('child_process').spawn('pbcopy')
proc.stdin.write(data)
proc.stdin.end()
}
and code in order to combine them together.
const inquirer = require('inquirer')
async function makeIssues() {
const {numberOfIssue} = await inquirer.prompt({
type: 'number',
name: 'numberOfIssue',
message: 'How many issues do you have today?',
})
const hr = Array.from({length: 50}, () => '-').join('')
const subIssues = Array.from({length: 3}, () => SUB_ISSUE_TEMPLATE).join('')
const issues = Array.from(
{length: numberOfIssue},
() => ISSUE_TEMPLATE + subIssues,
).join(`\n// ${hr}\n`)
pbcopy(issues)
}
makeIssues()
Finally, I only need to publish this package to npm
.
I already create an account in npm
and only need to run:
npm publish
Now I had mainichi-issues
in the npm market. I'm going to install it to my computer.
npm install mainichi-issues
and add this bash code
to .zshrc
:
alias mkis="node node_modules/mainichi-issues/index.js";
Now, every morning, I only need to type mkis
, and input the number of issues I'd like to have. I will have the issues templates.😃
Top comments (2)
Good but I don't know what is happening
I think you can use the template for whatever problem(programming) you have.