To set up the project you’ll need:
- Node version 6 (you can install it with nvm)
- npm version 3 (comes with Node 6)
- git
Then run these commands:
git clone https://github.com/kentcdodds/es6-todomvc.git
| var byMonth = R.groupBy(R.prop('Month')); | |
| var byAuthor = R.groupBy(R.prop('Author')); | |
| var royalty_key = 'Royalty (SUM)'; | |
| var months_keys = R.uniq(R.map(R.prop('Month'), data)).sort(); | |
| var monthly_revenue = | |
| R.map((group) => | |
| R.reduce((acc, record) => acc + parseMoney(record[royalty_key]), 0, group), | |
| byMonth(data)); |
| Input: | |
| { 'Jon': { '7/2016': 11026, '8/2016': 10793, '9/2016': 5526 }, | |
| 'Max': { '7/2016': 62911, '8/2016': 59902, '9/2016': 46801 }, | |
| 'Phil': { '7/2016': 40233, '8/2016': 45060, '9/2016': 44902 }, | |
| 'Tim': { '7/2016': 61083, '8/2016': 68584, '9/2016': 70511 }} | |
| Output: | |
| [ { 'Author': 'Jon, '7/2016': 11026, '8/2016': 10793, '9/2016': 5526 }, |
To set up the project you’ll need:
Then run these commands:
git clone https://github.com/kentcdodds/es6-todomvc.git
| // ==UserScript== | |
| // @name Remove Promoted Tweets and Activity Tab | |
| // @namespace http://twitter.com | |
| // @version 0.1 | |
| // @description Remove Twitter Garbage | |
| // @author You | |
| // @match https://twitter.com/* | |
| // @grant none | |
| // ==/UserScript== |
I hereby claim:
To claim this, I am signing this object:
| // replace # with the number of the step you are on | |
| git fetch origin | |
| git reset --hard | |
| git branch --track fem-# origin/fem-# | |
| git checkout fem-# | |
| git clean -f |
| :+1: -> 👍 |
| Express 2 was used in the course and the current version is 4.x. | |
| you can't just use 'urlencoded' anymore, you have to: | |
| npm install body-parser | |
| and | |
| var bodyParser = require('body-parser'); | |
| app.use(bodyParser.urlencoded({ extended: true })); |
| var fs = require('fs'); | |
| // npm install csv-parse | |
| var parse = require('csv-parse'); | |
| // CSV with ONLY the codes you want to give away | |
| var prepaid_codes_file = 'giveaway-codes.csv'; | |
| var emails_file = 'giveaway-emails.csv'; | |
| var Mailgun = require('mailgun').Mailgun; |
| var comments = document.querySelectorAll('#comment-list > li'); | |
| var commentsList = []; | |
| var array = new Uint32Array(comments.length); | |
| var randomIds = window.crypto.getRandomValues(array); | |
| Array.prototype.forEach.call(comments, function(el, i){ | |
| if (el.id) commentsList.push({id: el.id, rand: randomIds[i]}); | |
| }); |