-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds skills folder to repo and loads markdown for each skill #302 #336
Changes from all commits
ea5218e
ebc6b85
e2b7403
fd0babb
a5917bf
f247fe5
fdb3b90
c4967af
0f2d1ab
327d40d
3dd21ef
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#!/usr/bin/env node | ||
|
||
const fs = require('fs') | ||
|
||
const digest = require('../digest') | ||
|
||
function fsPromise(funcName, params) { | ||
return new Promise((resolve, reject) => { | ||
fs[funcName](...params, (error, result) => { | ||
if (error) { | ||
reject(error) | ||
return | ||
} | ||
resolve(result) | ||
}) | ||
}) | ||
} | ||
|
||
function makeDirectories() { | ||
digest() | ||
.then(digestInfo => Object.keys(digestInfo.skills)) | ||
.then(skillsArray => { | ||
const arrOfDirs = [] | ||
skillsArray.forEach(skill => { | ||
skill = skill.replace(/[\'\,\/]/g, '-') | ||
arrOfDirs.push(fsPromise('mkdir', ['./skills/' + skill])) | ||
}) | ||
}) | ||
} | ||
|
||
function main(args) { | ||
if (args.length <= 2 || args.length > 3) { | ||
console.log( | ||
`Not enough arguments.\n` + | ||
`Usage: ./bin/${args[1].match(/[^\/]*$/g)[0]} <dirs | populate>\n\n` + | ||
`dirs: Make empty directories based on module folder names\n` + | ||
`populate: Create sample README.md files in each skill folder\n` | ||
) | ||
return | ||
} | ||
|
||
({ | ||
'dirs': makeDirectories, | ||
'skills': createSkillsListTest, | ||
'populate': createSkillsList, | ||
})[args[2]]() | ||
} | ||
|
||
let skillsId = [] | ||
let skillsName = [] | ||
|
||
function createSkillsListTest() { | ||
digest() | ||
.then(digestInfo => { | ||
const digestSkills = digestInfo.skills | ||
for(let skill in digestSkills) { | ||
skillsId.push(skill) | ||
skillsName.push(digestSkills[skill].name) | ||
} | ||
}) | ||
.catch(error => { | ||
console.error('Something went wrong', error) | ||
}) | ||
} | ||
|
||
function createSkillsList() { | ||
digest() | ||
.then(digestInfo => { | ||
const digestSkills = digestInfo.skills | ||
for(let skill in digestSkills) { | ||
skillsId.push(skill) | ||
skillsName.push(digestSkills[skill].name) | ||
} | ||
return createSampleFiles(skillsId, skillsName) | ||
}) | ||
.catch(error => { | ||
console.error('Something went wrong', error) | ||
}) | ||
} | ||
|
||
function createSampleFiles(skillsId, skillsName) { | ||
console.log('skill Title length ---', skillsId.length) | ||
for(let i = 0; i < skillsId.length; i++){ | ||
const sampleData = | ||
`# ${skillsName[i]}\n\n` + | ||
`_description tbd_\n\n` + | ||
`## Resources\n\n` + | ||
`### Reading\n\n` + | ||
`_nothing here yet, please add something_\n\n` + | ||
`### Watching\n\n` + | ||
`_nothing here yet, please add something_\n` | ||
|
||
fsPromise('writeFile', [`./skills/${skillsId[i]}.md`, sampleData]) | ||
} | ||
return true | ||
} | ||
|
||
|
||
main(process.argv) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
# Grocery Queries Exercise | ||
|
||
___Note:__ This module assumes you've already installed postgresql via homebrew. If you have not done that please do back and do the [Installfest](../Installfest) module._ | ||
___Note:__ This module assumes you've already installed postgresql via homebrew. If you | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. these changes should not be in this PR. please remove There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very curious that our README somehow picked up those changes. Not even sure what or whose branch that is from. Will revert... just curiously commenting. edit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
have not done that please do back and do the [Installfest](../Installfest) | ||
module._ | ||
|
||
## Skills | ||
|
||
___Note:__ all of the skills below are applicable to any SQL server but were practicing them in postgresql_ | ||
___Note:__ all of the skills below are applicable to any SQL server but were | ||
practicing them in postgresql_ | ||
|
||
- Can select everything from a single table in SQL | ||
- Can select specific columns from a single table in SQL | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"dev": "nodemon web-server", | ||
"start": "node web-server", | ||
"db:migrate": "knex migrate:latest", | ||
"test": "mocha -G -r ./mocha.config.js $(find digest web-server database backoffice | grep .test.js) ", | ||
"test": "mocha -G -r ./mocha.config.js $(find digest web-server database backoffice skills | grep .test.js) ", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i dont think we'll put any tests in there. please remove this change |
||
"test:watch": "npm test -- --watch", | ||
"webpack": "webpack --config ./web-server/webpack.config.js", | ||
"heroku-prebuild": "npm install && npm run webpack" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can add `./node_modules/.bin` to your `$PATH`, in the shell | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can add Git metadata to your shell prompt | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can add a custom bin directory to their Shell config, in the terminal | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can add authorization to an HTTP API to restrict access to certain resources | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can add features to a pre-existing Node codebase | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can add properties to the prototype of a JavaScript Constructor | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can affectively manipulate the DOM in a Browser | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can assess what an appropriate salary is for my experience level at a hiring company | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can author a JavaScript RegExp with a character set | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Can author a Regular Expression by using the RegExp constructor | ||
|
||
_description tbd_ | ||
|
||
## Resources | ||
|
||
### Reading | ||
|
||
_nothing here yet, please add something_ | ||
|
||
### Watching | ||
|
||
_nothing here yet, please add something_ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i know i asked for this but i've changed my mind :)