View sequelize-error.md

Sequelize Error: Invalid value [object Object]

Error: Invalid value [object Object]

This happens when you think you are passing an integer or string, and you are actually passing in an object!

Somethign like this will produce the same error.

View sequelize-promise-migration.js
"use strict";
module.exports = {
up: function(queryInterface, Sequelize) {
//
// queryInterface methods DO return promises. Either of the following with work
//
// return queryInterface.addColumn(...)
// .then(() => queryInterface.doSomething(...))
// etc.
View atom.styles.less
// get rid of the yellow js file icon
// yellow means modified with the gh plugins
// change to grayish, not yellow
//
// add this to atom's style.less file:
.icon[data-name$=".js"]:before {
font-family: Devicons;
color: #828997;
content: "\E64E";
}
View test.js
//FooModule
module.exports.bar = () => {
return "hello bar";
};
// my file under test:
const foo = require("./FooModule");
console.log(foo.bar()); // returns "hello bar"
// stubbing a method to return a new value
View testTime.js
// I was testing some functionality that relied on `moment()`.
// I wanted to fake the value of the time Moment uses so I could test return values.
// Here is the method I used. Reference: https://stackoverflow.com/a/31591297/1478950
const test = require("ava");
const sinon = require("sinon");
const moment = require("moment");
let sandbox;
View npm-publish-diff.md
View promise.js
// Sometimes I have a promise chain that returns out of a promise before
// the the execution is actually completed. Maybe i'm not returning correctly?
// Anyway, might be a common problem for a newb, like me.
// here is a way to add a delay in the promise chain to wait for the previous
// promise to complete. This is NOT best practice, but maybe it can be used as
// a troubleshooting tool.
//
...
.then(() => {...})
.then(() => {
View cannot-read-property-getTableName.md

TypeError: Cannot read property 'getTableName' of undefined or foo.bar is not a function

I've had this error on numerous occasions. Here are a few things to look for:

  • Check that the table name that is included in the query is spelled correctly, check that is it defined correctly (for sequelize).
  • If you are running tests and using Mockery, check that Mockery is setup correctly. Try removing Mockery and running the test.
  • Check that if you are trying to stub with Sinon, that Mockery isn't ALSO trying to stub out the same object.
  • Example of stubbing with Sinon instead of Mockery: https://gist.github.com/todgru/e439373af2488eefc30ae8bd1fe3864a
View BBC-Radio.m3u
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio1_mf_p
#EXTINF:-1,BBC - Radio 2
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio2_mf_p
#EXTINF:-1,BBC - Radio 3
http://open.live.bbc.co.uk/mediaselector/5/select/version/2.0/mediaset/http-icy-aac-lc-a/format/pls/vpid/bbc_radio_three.pls
#EXTINF:-1,BBC - Radio 4
http://bbcmedia.ic.llnwd.net/stream/bbcmedia_radio4fm_mf_p
#EXTINF:-1,BBC - Radio 5 live
View knit.rb
#!/usr/bin/env ruby
# recursively `yarn link` together all `file:<path>` deps in package.json
# manifests.
#
# USAGE
#
# knit.rb PACKAGE_DIRECTORY
#
# AUTHOR nrser