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
const co = require('co'); | |
const json2xls = require('json2xls'); | |
module.exports = function() { | |
co(function*() { | |
const Insight = require('../../app/models/insight'); | |
const fs = require('fs'); | |
const games = yield Insight.find({ |
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
module.exports = function() { | |
const Workout = require('../../app/models/workout'); | |
const fs = require('fs'); | |
const co = require('co'); | |
require('../../app/models/level'); | |
require('../../app/models/topic'); | |
require('../../app/models/subtopic'); | |
const getWorkoutTitle = function(workout) { |
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
const co = require('co'); | |
const fs = require('fs'); | |
require('../../app/models/topic'); | |
require('../../app/models/level'); | |
const User = require('../../app/models/user'); | |
function extractLevelMajority(topicsArray) { | |
let beginner = 0; |
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
const User = require('../../app/models/user'); | |
module.exports = function() { | |
const query = { | |
topics: { $exists: true}, | |
'onboardingSteps.0': 'revision', | |
} | |
/* eslint-disable */ | |
const o = {}, |
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
const co = require('co'); | |
require('../../app/models/topic'); | |
require('../../app/models/level'); | |
const User = require('../../app/models/user'); | |
const Workout = require('../../app/models/workout'); | |
module.exports = function() { | |
co(function*() { |
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
const co = require('co'); | |
const moment = require('moment'); | |
const User = require('../../app/models/user'); | |
const Workout = require('../../app/models/workout'); | |
/* | |
Script used to get an accurate estimate of returning users on a specific date | |
( + the following day ). | |
E.g. On 13th of July we sent an email. The question is how many users that dind't |
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
// const util = require('util'); | |
const co = require('co'); | |
const fs = require('fs'); | |
const C = require('common/constants'); | |
const User = require('../../app/models/user'); | |
const InsightReview = require('../../app/models/insightReview'); | |
const Topic = require('../../app/models/topic'); | |
const Insight = require('../../app/models/insight'); |
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
const co = require('co'); | |
const fs = require('fs'); | |
const User = require('../../app/models/user'); | |
const Topic = require('../../app/models/topic'); | |
const Insight = require('../../app/models/insight'); | |
const Level = require('../../app/models/level'); | |
const Subtopic = require('../../app/models/subtopic'); | |
// function to dynamically instantinate nested objects by assignment |
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
export default function (string) { | |
return ( | |
string | |
.toLowerCase() | |
.replace(/\s+/g, '-') | |
// eslint-disable-next-line | |
.replace(/[^\w\-]+/g, '') | |
// eslint-disable-next-line | |
.replace(/\-\-+/g, '-') | |
.replace(/^-+/, '') |
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
const currPath = 'path'; | |
const aspects = ['new', 'workout', 'blah']; | |
fs | |
.readDirSync(currPath) | |
.filter(folder => folder !== 'archived') | |
.forEach(topicName => | |
fs | |
.readDirSync(path.join(currFolder, topicName)) | |
.filter(folder => folder !== 'README.md') |