- Actually reasonable Mongo driver (with pluggable schema validators)
- Reasonable Mongo schema validator
- Nestable routes for
zeit/micro
- Nice test suite ergonomics
- Ava actually does a much better job than Mocha or Jest here
- Want context variables (like in Ava)
- Want chainable middleware
context
anddescribe
(each can mutate context variables and have their own lifecycle hooks (beforeEach
,before
, etc.)
- Babel plugin to transform arrow function class properties to be implemented using
prototype
andbind
rather than making the function in the constructor - Doing a
bind
is cheaper than creating the whole function every time!
This file contains hidden or 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
print-type-size type: `Big`: 24 bytes, alignment: 8 bytes | |
print-type-size discriminant: 1 bytes | |
print-type-size variant `Sixteen`: 16 bytes | |
print-type-size field `.0`: 16 bytes | |
print-type-size variant `Float`: 15 bytes | |
print-type-size padding: 7 bytes | |
print-type-size field `.0`: 8 bytes, alignment: 8 bytes | |
print-type-size variant `Twelve`: 12 bytes | |
print-type-size field `.0`: 12 bytes | |
print-type-size variant `Eight`: 8 bytes |
This file contains hidden or 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 benchmark = require('benchmark'); | |
const suite = new benchmark.Suite(); | |
suite.add('var loop', () => { | |
var hi, i, list; | |
list = []; | |
for (i = 0; i < 50; ++i) { | |
hi = { str: 'hi', i }; |
This file contains hidden or 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
categorySchema.find({}) | |
.exec() | |
.then(categories => { | |
// When you return a promise from a .then callback, the promise that gets returned from the original .then | |
// resolves when the inner promise that you return resolves | |
return Promise.all(categories.map(cat=> { | |
return brandSchema.find({category: cat._id}).count() | |
})); | |
}) | |
.then(counts => { |
This file contains hidden or 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
class Klass { | |
Klass(const Param & p1, const Param & p2) | |
: | |
m1(p1), | |
m2(p2) | |
{} | |
Param m1; | |
Param m2; | |
} |
This file contains hidden or 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
arr = ["cup", "cake", "birthday", "Jesus"] | |
# this will print "cup\ncake\nbirthday\nJesus", as you can imagine | |
for word in arr | |
puts word | |
end | |
def add_em_up() | |
acc = 5 | |
for word in arr |
This file contains hidden or 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
FUNCTION airline#extensions#neomake#get_errors() | |
Called 340 times | |
Total time: 0.006676 | |
Self time: 0.002922 | |
count total (s) self (s) | |
340 0.005072 0.001318 let counts = neomake#statusline#LoclistCounts() | |
340 0.000847 let errors = get(counts, 'E', 0) | |
340 0.000525 return errors ? s:error_symbol.errors : '' |
This file contains hidden or 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
health#deoplete#check | |
======================================================================== | |
## deoplete.nvim | |
- SUCCESS: has("nvim") was successful | |
- SUCCESS: has("python3") was successful | |
- INFO: If you're still having problems, try the following commands: | |
$ export NVIM_PYTHON_LOG_FILE=/tmp/log | |
$ export NVIM_PYTHON_LOG_LEVEL=DEBUG | |
$ nvim |
- It adds defaults to models if the schema has them, but does not remove invalid fields from
.toJSON
when pulling them out of Mongo- But it does remove it for the model object
.inspect
reflects the.toJSON
version, so debugging is basically impossible
- Can't use object spread with a model to get a new version of it
- There's no way to have
.update
update the model in-place - I mean I don't want it to be the default, but having the option would be nice
NewerOlder