Skip to content

Commit

Permalink
Merge pull request #6 from Financial-Times/halp
Browse files Browse the repository at this point in the history
HALP
  • Loading branch information
adgad authored Jan 22, 2018
2 parents 8e6cfa9 + 51d5071 commit 92b268f
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 5 deletions.
13 changes: 10 additions & 3 deletions bin/n-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

let program = require('commander');

const halp = require('../tasks/halp');

program.version(require('../package.json').version);


Expand All @@ -15,9 +17,14 @@ program
.command('*')
.description('')
.action(function (app) {
// eslint-disable-next-line no-console
console.error(`The command ${app} is not known`);
process.exit(1);

if(app && app.toUpperCase().startsWith('HALP')) {
halp();
} else {
// eslint-disable-next-line no-console
console.error(`The command ${app} is not known`);
process.exit(1);
}
});


Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
},
"homepage": "https://github.com/Financial-Times/n-test#readme",
"dependencies": {
"chalk": "^2.3.0",
"commander": "^2.13.0",
"jest": "^22.0.6",
"puppeteer": "^1.0.0"
Expand Down
57 changes: 57 additions & 0 deletions tasks/halp.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
const chalk = require('chalk');

const messages = [
chalk`It\'s time to put the {bold FUN} back in function`,
chalk`'You can do this. Just {italic breath} ☺️`,
'GO GET EM TIGER 🐯A',
'It\'s not the number of lines of code we write, but the lines of code that take our breath away.',
'Life is not about the software we write, but the friends we make along the way',
'You\'re only as strong as the o-colors you mix, the o-tables you dance on and the o-friends you party with.',
'Code, laugh, love',
'Sing like no one is listening. Love like you\'ve never been hurt. Develop like nobody is debugging.',
'Every great developer you know got there by solving problems they were unqualified to solve until they actually did it.',
'"That brain of mine is something more than merely mortal, as time will show." - Ada Lovelace',
'"Testing leads to failure, and failure leads to understanding." - Burt Rutan',
'"Sometimes it\'s better to leave something alone, to pause, and that\'s very true of programming." - Joyce Wheeler',
'"Codes are a puzzle. A game, just like any other game." - Alan Turing',
'Write every function like it\'s your last.',
'You miss 100% of the bugs you don\'t make',
'Don\'t forget to debug yourself first',
'Believe there is good in your code.',
'Take a walk. Make some tea. Go talk to some of your awesome colleagues (but not in the kitchen).',
'Keep calm and curry on. (don\'t worry - nobody really knows what currying is)',
'Be the change request you want to see in the world.',
'Forget the module. What do YOU require?',
'Once upon a time, some idiot put display: none on the FT.com homepage on budget day. They survived. So can you.',
'If Slack can use 110% of CPU time, then so can you!',
'Think outside the box model.',
'If ever you feel like you\'re losing control, remember that there is a variant of you that\'s itching to take it.',
'git reset --HARD life',
'rm -rf all_of_your_problems',
'Polyfill your day with positivity!',
'In the end it\'s all just 1s and 0s.'

];

const characters = [
chalk`{bgRed \n (* ^ ω ^)\n}`,
chalk`{bgGreen \n٩(◕‿◕。)۶\n}`,
chalk`{bgBlue \n(⌒ω⌒)\n}`,
chalk`{bgYellow \n(*^‿^*)\n}`,
chalk`{bgCyan \n(*¯︶¯*)\n}`,
chalk`{bgWhite.cyan \n٩(◕‿◕)۶\n}`,
chalk`{magenta \n(✯◡✯)\n}`,
chalk`{blue \n(ノ◕ヮ◕)ノ*:・\n}`
];


const halp = () => {
const character = characters[Math.floor(Math.random()*characters.length)];
const message = messages[Math.floor(Math.random()*messages.length)];
// eslint-disable-next-line no-console
console.log(character);
// eslint-disable-next-line no-console
console.log(message);
};

module.exports = halp;
2 changes: 0 additions & 2 deletions tasks/smoke.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
const smokeTests = require('../lib/smoke');



module.exports = (program) => {
program
.command('smoke')
Expand Down

0 comments on commit 92b268f

Please sign in to comment.