text 在事件上添加/删除css类

在事件上添加/删除css类

toggleclass

//HTML
<div class="container main">
	<div class="row">
		<h2 class=color-change>Create your snippet's HTML, CSS and Javascript in the editor tabs</h2>
	</div>
</div>

//css
.main {
    height:500px;
background:#f33;
}
.yellow {
    background:yellow;
}

//jquery

$(document).ready(function(){
	$(".color-change").click(function(){
		$(".main").toggleClass("yellow");
	});
});

text Git命令

Git命令

git_comands
git fetch --all && git reset --hard origin/master

text URL参数对象

抓住URL参数并将它们放入一个漂亮的对象中。 <br/> <br/>示例:http://example.com/?product = shirt&color = blue&newuser&size = m <br/> <br/>用法:<br/> getAllUrlParams()。product; //'衬衫'<br/> getAllUrlParams()。color; //'blue'<br/> getAllUrlParams()。newuser; // true <br/> getAllUrlP

urlParamsObject
function getAllUrlParams(url) {

  // get query string from url (optional) or window
  var queryString = url ? url.split('?')[1] : window.location.search.slice(1);

  // we'll store the parameters here
  var obj = {};

  // if query string exists
  if (queryString) {

    // stuff after # is not part of query string, so get rid of it
    queryString = queryString.split('#')[0];

    // split our query string into its component parts
    var arr = queryString.split('&');

    for (var i=0; i<arr.length; i++) {
      // separate the keys and the values
      var a = arr[i].split('=');

      // in case params look like: list[]=thing1&list[]=thing2
      var paramNum = undefined;
      var paramName = a[0].replace(/\[\d*\]/, function(v) {
        paramNum = v.slice(1,-1);
        return '';
      });

      // set parameter value (use 'true' if empty)
      var paramValue = typeof(a[1])==='undefined' ? true : a[1];

      // (optional) keep case consistent
      paramName = paramName.toLowerCase();
      paramValue = paramValue.toLowerCase();

      // if parameter name already exists
      if (obj[paramName]) {
        // convert value to array (if still string)
        if (typeof obj[paramName] === 'string') {
          obj[paramName] = [obj[paramName]];
        }
        // if no array index number specified...
        if (typeof paramNum === 'undefined') {
          // put the value on the end of the array
          obj[paramName].push(paramValue);
        }
        // if array index number specified...
        else {
          // put the value at that index number
          obj[paramName][paramNum] = paramValue;
        }
      }
      // if param name doesn't exist yet, set it
      else {
        obj[paramName] = paramValue;
      }
    }
  }

  return obj;
}

text BD_HB

BD_HB
<script>
    const adfoxBiddersMap = {
        'betweenDigital': '805911',
    };

	 var adUnits = [
        {
            code: 'adfox_152690712477615242',
			sizes: [[ 240, 400 ]],
            bids: [
                {
                    bidder: 'betweenDigital',
                    params: {
                        placementId: 111111,
                    }
                }
            ]
        },
        {
            code: 'adfox_152690712477686267',
			sizes: [[ 240, 400 ]],
            bids: [
                {
                    bidder: 'betweenDigital',
                    params: {
                        placementId: 222222,
                    }
                }
            ]
        },
		        {
            code: 'adfox_152690712477721063',
			sizes: [[ 240, 400 ]],
            bids: [
                {
                    bidder: 'betweenDigital',
                    params: {
                        placementId: 111111,
                    }
                }
            ]
        },
		        {
            code: 'adfox_152715960637581076',
			sizes: [[ 240, 400 ]],
            bids: [
                {
                    bidder: 'betweenDigital',
                    params: {
                        placementId: 111111,
                    }
                }
            ]
        }
    ];
	 var userTimeout = 500;
    window.Ya.headerBidding.setSettings({
        biddersMap: adfoxBiddersMap,
        adUnits: adUnits,
        timeout: userTimeout
    });
</script>

text Octobercms油门

Octobercms throttle
$throttleKey = sha1(request()->route()->getDomain().'|'.request()->ip());
if(!$this->throttle($throttleKey)) {
    $availableIn = Cache::get($throttleKey.':timer') - Carbon::now()->getTimestamp();
    throw new \Exception('Blocked for ' . $availableIn);
}
protected function throttle($throttleKey)
{
    $maxAttempts = 5;
    $decayMinutes = 1;
    $attempts = Cache::get($throttleKey,0);
    if($attempts >= $maxAttempts) {
        if (Cache::has($throttleKey.':timer')) {
            return false;
        }

        Cache::forget($throttleKey);
    }

    Cache::add($throttleKey.':timer', Carbon::now()->addSeconds($decayMinutes * 60)->getTimestamp(), $decayMinutes);

    $added = Cache::add($throttleKey, 0, $decayMinutes);

    $hits = (int) Cache::increment($throttleKey);

    if (! $added && $hits == 1) {
        Cache::put($throttleKey, 1, $decayMinutes);
    }

    return true;
}

text 向商店推荐Cookie Hinweis / Notice

向商店推荐Cookie Hinweis / Notice

Adding Cookie Hinweis _ Notice to Shopware
1. Locate and dowload Template files from the server, normaly in the folowing rute: themes/Frontend/WEBSITENAME/frontend/index/
2. Create a new TPL file cookie-hinwise.tpl with all the html and javascript code
3. Call this cookie-hinwise.tpl in the footer.tpl:
{include file="frontend/index/cookie-hinweis.tpl"}
4. If there is no jquery.min.js file, add it in the header.tpl:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
5. Delete cache and check results

text 第一课

first lesson
Очередь - элемент добавляется в конец, обработка элементов происходит с начала (как обычная очередь)
Front - начало очереди
Back - конец очереди
Методы:
Enqueue(key) (PushBack) - Добавляет элемент в конец
Key Dequeue() (PopFront) - извлекает элемент из очереди
isEmpty()
size()

text MAMP:mySQL服务器gestopt

最佳方案! MAMP:mySQL服务器的停止状态遇到了draaien en gaat niet meer aan

mysqlstoptplots
// Quit MAMP. You may have to force quit when this happens as it does not shut down correctly.
// To show any MySQL processes currently running, open Terminal and from the command prompt run the command below.

pgrep mysql

// Next, kill the MySQL processes by running the command below.

pgrep mysql | xargs kill -9

// To verify they no longer exist, pgrep for mysql again and you should not have any processes returned.

pgrep mysql

// Now Launch MAMP again and MySQL Server should start normally.

text 安装NVM - OSX

http://dev.topheman.com/install-nvm-with-homebrew-to-use-multiple-versions-of-node-and-iojs-easily <br/>安装节点<br/> https:// nodesource的.com /博客/安装节点-JS-教程使用-NVM-上-MAC-OS-X - 和 - 的ubuntu /

nvm

text Zarządzaniepakietami

https://www.npmjs.com/package/npmvet - Wersjonowanie

pakiety
Usage: npmvet [options]

Options:

  -h, --help                 output usage information
  -V, --version              output the version number
  -p, --package <package>    package.json file location (Default: .)
  -m, --modules <modules>    node_modules folder location (Default: .)
  -r, --renderer <renderer>  Renderer to use (Default: inlinetable)
  -s, --strict               Using the CI renderer, fail build if any packages unlocked (Default: false, flag)