-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66fbb11
commit 99c6d16
Showing
5 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
node_modules | ||
dist | ||
tmp |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"files": ["package.json"], | ||
"entrypoint": "index.js", | ||
"installDependencies": true | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import open from 'open'; | ||
import axios from 'axios'; | ||
import tkit from 'terminal-kit'; | ||
|
||
const term = tkit.terminal; | ||
|
||
const GITHUB_USERNAME = 'lxchurbakov'; | ||
const GITHUB_REPOS_COUNT = 3; | ||
|
||
const WEBSITE_LINK = 'https://lxch.io'; | ||
const CALENDLY_LINK = 'https://calendly.com/lxch/job-interview'; | ||
|
||
term.white('👋 Hello fellow dev!\n\n'); | ||
|
||
term.white('I am'); | ||
term.cyan(' Alexander') | ||
term.white(' aka') | ||
term.cyan(' @lxchurbakov') | ||
term.white(', a JS/TS dev \nwith more than 8 years of productioin experience\n'); | ||
term.white('and I am looking for a job right now!\n'); | ||
|
||
const select = (items) => { | ||
return new Promise((resolve, reject) => { | ||
term.singleColumnMenu( items , (error, response) => { | ||
if (error) { | ||
reject(error); | ||
} else { | ||
resolve(response.selectedIndex); | ||
} | ||
}); | ||
}); | ||
}; | ||
|
||
;(async () => { | ||
|
||
await (async () => { | ||
const repos = await axios | ||
.get(`http://api.github.com/users/${GITHUB_USERNAME}/repos?per_page=${GITHUB_REPOS_COUNT}&sort=updated`) | ||
.then(({ data }) => data); | ||
|
||
term.white('\n🛠️ in the meantime I build useless stuff like:\n\n'); | ||
|
||
repos.forEach((repo) => { | ||
term.white( `○ ${repo.full_name} - ${repo.stargazers_count} ⭐\n`); | ||
term.italic(` ${repo.description}\n `); | ||
term.underline.dim(`${repo.url}\n`); | ||
}); | ||
})().catch((err) => { | ||
// Can't fetch repos | ||
}); | ||
|
||
// Here we fetch game status | ||
const { playing } = await axios.get('https://lichess.org/api/user/lxchurbakov').then(({ data }) => data) | ||
|
||
if (playing) { | ||
term.white('\n♖ Looks like I play chess now!\n'); | ||
term.white(' Visit this link to watch: '); | ||
term.underline.dim(playing); | ||
} | ||
|
||
// Here we proceed to the options | ||
// of what to do with this peeve page | ||
|
||
term.white('\n👀 What do you want to do now?\n'); | ||
|
||
const action = await select([ | ||
'Book an interview meeting on calendly', | ||
'Visit my website', | ||
]); | ||
|
||
if (action === 0) { | ||
open(CALENDLY_LINK); | ||
} | ||
|
||
if (action === 1) { | ||
open(WEBSITE_LINK); | ||
} | ||
|
||
process.exit(); | ||
})().catch((err) => { | ||
process.exit(-1); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"dependencies":{"axios":"^1.6.7","open":"^10.0.3","terminal-kit":"^3.0.1"},"type":"module"} |