Suggest sites to user based on URL matching and other information. Might require crawling the site or calling out to a search API like Duck Duck Go.
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
yarn-path "./yarn-1.12.3.js" |
Snapshots can be helpful, but if used improperly they can useless or even a burden.
Don't snapshot things you don't care about. Don't snapshot an entire wrapper component if you are only interested in a single subcomponent. You can use enzyme's find()
(available on both shallow and full wrappers).
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
/* | |
converts an array of objects into an array of row arrays, | |
suitable for use in e.g. a csv coversion (npm install csv-stringify) | |
includes the header row. | |
e.g. | |
objectArray = [{a: 1, b: 120}, {a: 2, c: 'horse'}] | |
toRows(objectArray) -> [ ['a', 'b', 'c'], [1, 120, undefined], [2, undefined, 'horse'] ] | |
*/ | |
const toRows = objectArray => { |
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
// quick and dirty populating ("joining") in Meteor | |
Mongo.Collection.prototype.findAndPopulate = function (selector, options, populates) { | |
/* | |
selector and options: from Mongo.Collection.prototype.find(selector, options) | |
populates: [Object] or Object | |
[{id, as, from}] or {id, as, from} | |
e.g. {id: 'userId', as: 'thisUser', from: Users} | |
will look up doc.userId in Users and assign to doc.thisUser | |
--> doc.thisUser = Users.findOne(doc.userId); | |
*/ |
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
<!DOCTYPE html> | |
<html > | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/> | |
<title>chris bolin 2</title> | |
<link rel="stylesheet" href="css/normalize.css"> |
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 repl = require('repl'), | |
keystone = require('keystone'); | |
module.exports = function(done) { | |
var shell = repl.start({ | |
prompt: 'keystone > ' | |
}); | |
// expose keystone to the shell | |
shell.context.keystone = keystone; |
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
# .env as used in https://github.com/bkeepers/dotenv | |
export $(cat .env) |
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 collectionNames = db.getCollectionNames(), stats = []; | |
collectionNames.forEach(function (n) { stats.push(db[n].stats()); }); | |
stats = stats.sort(function(a, b) { return b['storageSize'] - a['storageSize']; }); | |
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['storageSize']); } |
NewerOlder