Skip to content

Instantly share code, notes, and snippets.

recursion

sum с аккумулятором

function sum(a,b) {
        return sumRangeAcc(a,b,0)
}

function sumRangeAcc(a,b,sum) {
self.addEventListener('push', function(event) {
// Since there is no payload data with the first version
// of push messages, we'll grab some data from
// an API and use it to populate a notification
event.waitUntil(
fetch(SOME_API_ENDPOINT).then(function(response) {
if (response.status !== 200) {
// Either show a message to the user explaining the error
// or enter a generic message and handle the
// onnotificationclick event to direct the user to a web page
@wangel13
wangel13 / gallery.php
Last active April 17, 2016 11:35
ACF snippets
@wangel13
wangel13 / tabs.js
Last active February 23, 2016 18:40
tabs.js
'use strict';
function Tabs() {
var bindAll = function() {
var menuElements = document.querySelectorAll('[data-tab]');
for(var i = 0; i < menuElements.length ; i++) {
menuElements[i].addEventListener('click', change, false);
}
}
var path = require('path');
module.exports = {
entry: path.resolve(__dirname, '../src/app.js'), // Точка входа
output: {
path: path.resolve(__dirname, '../build'), // Точка выхода
filename: "bundle.js"
}
}