Skip to content

Instantly share code, notes, and snippets.

View Elergy's full-sized avatar

Evgenii Ponomarev Elergy

View GitHub Profile
// before
function isOutsideInterval(value, minimum, maximum, limits) {
return value < limits.minimum || value > maximum;
}
// after
function isOutsideInterval(value, minimum, maximum, limits) {
return value < limits.minimum || value > limits.maximum;
}
// before
const shouldShowError = isOutsideInterval(value, minimum, maximum, {
minimum,
maximum
});
function isOutsideInterval(value, minimum, maximum, limits) { ... }
// after
// before
const shouldShowError = isOutsideInterval(value, {
minimum,
maximum
});
// after
const limits = { minimum, maximum };
{
"manifest_version": 2,
"name": "Borderify",
"version": "1.0",
"description": "Adds a red border to all webpages matching mozilla.org.",
"icons": {
"48": "icons/border-48.png"
{
"name": "Getting Started Example",
"version": "1.0",
"description": "Build an Extension!",
"manifest_version": 2
}
{
"name": "my-first-extension",
"version": "1.0",
"manifest_version": 2
}
{
"name": "my-first-extension",
"version": "1.0.0",
"manifest_version": 2,
"application": {
"id": "myfirstextension@evgenii.info"
}
}
function getAllDragons() {
try {
const infoAboutDragons = DATABASE.getAll({type: 'dragons'});
return infoAboutDragons;
} catch (ex) {
throw new DatabaseError();
}
}
function getInformationAboutPets() {
const cats = CAT_SERVICE.getAllCats();
const dogs = DOG_SERVICE.getAllDogs();
const dragons = DRAGON_SERVICE.getAllDragons();
return [cats, dogs, dragons];
}
web-ext sign --api-key=user:14760837:724 --api-secret=967445ccc5c6127bd423dcb6b2d2fe00e23471ec60d22d52fa6aec0857c0ad5e