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
User.find({'profile.picture': /twimg.*_normal/}, function(err, users, done) { | |
if (err) { debug('Username err: ', err); next(err); } | |
for (var i = 0; i < users.length; i++) { | |
console.log(users[i].profile.picture); | |
users[i].profile.picture = users[i].profile.picture.replace('_normal', ''); | |
users[i].save(function(err) { | |
if (err) { return next(err); } | |
done(err, user); | |
}); | |
console.log(users[i].profile.picture); |
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
db.users.find({'profile.picture': /twimg.*_normal/}).forEach( function(user) { | |
var picture = user.profile.picture.replace(/_normal/, ''); | |
user.profile.picture = picture; | |
db.users.save( user ); | |
print(user.profile); | |
}); | |
db.users.find({email: /@twitter.com/}).forEach( function(user) { | |
var username = user.email.replace('@twitter.com', ''); | |
user.profile.username = username; |
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
/** | |
* In Express | |
*/ | |
exports.getAccount = function(req, res) { | |
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) { | |
if (err) { | |
console.error('Challenge err: ', err); | |
next(err); | |
} | |
res.render('account/profile', { |
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
/** | |
* Angular API Call | |
*/ | |
exports.getAccountAngular = function(req, res) { | |
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) { | |
if (err) { | |
console.error('Challenge err: ', err); | |
next(err); | |
} |
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
{ | |
"name": "Palindrome Tester", | |
"difficulty": 1, // should be a range from 1-5 | |
"description": [ | |
"Your job is to determine if a provided string is a palindrome.", | |
"The definition of a palindrome can be found at http://en.wikipedia.org/wiki/Palindrome.", | |
"Strings will be passed in with varying formats, such as \"racecar\", \"RaceCar\", and \"race CAR\" among others.", | |
"Return true if the string is a palindrome, otherwise false" | |
], | |
"publicTests": [ |
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
/** | |
* Jquery related stuffs | |
*/ | |
function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash) { | |
$('#complete-bonfire-dialog').modal('show'); | |
// Only post to server if there is an authenticated user | |
if ($('.signup-btn-nav').length < 1) { | |
$.ajax({ | |
type: 'POST', | |
data: { |
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
var paths = { | |
main: './client/client.js', | |
jsx: './common/components/**/*.jsx', | |
publicJs: './public/js', | |
server: './server/server.js', | |
serverIgnore: [ | |
'gulpfile.js', | |
'public/', | |
'components/**/*.styl', | |
'bower_components/', |
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
process.env.DEBUG = process.env.DEBUG || 'freecc:*'; | |
var _ = require('lodash'), | |
gulp = require('gulp'), | |
// ## debug | |
bundleLogger = require('./gulpUtils/bundleLogger'), | |
handleErrors = require('./gulpUtils/handleErrors'), | |
// ## bundle | |
bundleName = require('vinyl-source-stream'), |
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
Array.prototype.concatAll = function() { | |
var results = []; | |
this.forEach(subArray => { | |
subArray.forEach(item => { | |
results.push(item); | |
}); | |
// ------------ INSERT CODE HERE! ---------------------------- | |
// Add all the items in each subArray to the results array. | |
// ------------ INSERT CODE HERE! ---------------------------- | |
}); |
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
return movieLists.map(genres => | |
genres.videos.map(video => | |
video.boxarts.filter(boxart => | |
boxart.width === 150 && boxart.height === 200 | |
).map(boxart => { | |
return ({ | |
id: video.id, | |
title: video.title, | |
boxart: boxart.url | |
}) |
OlderNewer