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
/* eslint-env jest */ | |
const mockDebug = jest.fn() | |
jest.mock('debug', () => { | |
return () => mockDebug | |
}) | |
const foo = require('./foo') | |
describe('foo.bar', () => { | |
it('should testName', () => { |
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
{ | |
/* | |
// Place your snippets for JavaScript here. Each snippet is defined under a snippet name and has a prefix, body and | |
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the | |
// same ids are connected. | |
// Example: | |
"Print to console": { | |
"prefix": "log", | |
"body": [ |
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
{ | |
"title": "Hello Mundo" | |
} |
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
{ | |
"title": "Hello World" | |
} |
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
{ | |
"showExclamation": true | |
} |
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
Hello world!! |
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
exports = { | |
'source:getTrending': { | |
url: 'http://api.giphy.com/v1/gifs/feqkVgjJpYtjy?api_key=dc6zaTOxFJmzC' | |
} | |
}; |
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
exports = { | |
'source:getTrending': { | |
url: 'http://api.giphy.com/v1/gifs/trending?api_key=dc6zaTOxFJmzC' | |
}, | |
// get all images | |
'model:getAllImages': { | |
// will execute source:getTrending and pass it as the context | |
before: 'source:getTrending', | |
// because the service returns everything | |
// under 'data' property, this will access that path |
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 getPageTitle(ctx, done) { | |
const data = ctx.value; | |
const regex = new RegExp(/title>(.*?)<\/title>/g); | |
const title = data.match(regex); | |
done(null, {title: title}); | |
} | |
exports = { | |
"source:everything": { | |
"url": "http://api.nick.com/api/v2/tv-schedule/?apiKey=nickjr.com&numberOfDays=2", | |
}, |
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
/* | |
* credit of `getMatchedStyle` method for stakoverflow's Qtax | |
* http://stackoverflow.com/questions/9730612/get-element-css-property-width-height-value-as-it-was-set-in-percent-em-px-et/9733051#9733051 | |
*/ | |
function getMatchedStyle(elem, property) { | |
// element property has highest priority | |
var val = elem.style.getPropertyValue(property); | |
// if it's important, we are done | |
if (elem.style.getPropertyPriority(property)) |
NewerOlder