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 Machine() { | |
this._enabled = false; | |
this.enable = function() { | |
this._enabled = true; | |
}; | |
this.disable = function() { | |
this._enabled = false; | |
}; | |
} |
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
rm -rf /Applications/PhpStorm.* | |
rm -rf ~/Library/Preferences/jetbrains.* | |
rm -rf ~/Library/Logs/JetBrains/PhpStorm* | |
rm -rf ~/Library/Caches/PhpStorm* | |
rm -rf ~/Library/Caches/JetBrains/PhpStorm* | |
rm -rf ~/Library/Application\ Support/PhpStorm* | |
rm -rf ~/Library/Application\ Support/JetBrains* | |
rm -rf ~/Library/ApplicationSupport/PhpStorm* | |
rm -rf ~/Library/ApplicationSupport/JetBrains* |
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
<?php | |
/** | |
* Special implementation of chunk | |
* Used in case when records' count depends on dynamic condition and decreases during performing to zero | |
* In this way default chunk of query builder can't work correctly | |
* @param $query | |
* @param $callback | |
*/ | |
private function chunkForDecreasesCollection($query, $callback) |
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
SET GLOBAL sql_mode = (SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); | |
SET SESSION sql_mode = (SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); | |
SELECT @@sql_mode; |
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
@if(preg_match('%(?:youtube(?:-nocookie)?\.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.*[?&]v=)|youtu\.be/)([^"&?/ ]{11})%i', $link, $match)) | |
<iframe type="text/html" | |
src="https://www.youtube.com/embed/{!! $match[1] !!}?rel=0&showinfo=0&color=white&iv_load_policy=3" | |
frameborder="0" allowfullscreen></iframe> | |
@elseif (!empty($link)) | |
<a href="{!! $link !!}">Video</a> | |
@endif |
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
<?php | |
use Mailgun\Mailgun; | |
use Setting; | |
/** | |
* Pagination for Mailgun events API | |
* Retrieves all new (not have retrieved yet) events for each run | |
* See main code at processNewEvents() | |
* |
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
console.log(JSON.parse(JSON.stringify(ojbect))); | |
//or | |
console.log(array.slice()); | |
//or | |
console.group('group'); | |
array.forEach(function(item) { |
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
show folders: | |
ls ~/Library/Preferences/jetbrains.* | |
ls ~/Library/Preferences/PhpStorm* | |
ls ~/Library/Caches/PhpStorm* | |
ls ~/Library/Application\ Support/PhpStorm* | |
ls ~/Library/Logs/PhpStorm* | |
remove folders: |
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
<?php | |
/** | |
* File with functions called in the wordpress site by including this file | |
* | |
* Name all functions by prefix "Lr" for clear understanding in the wordpress code | |
*/ | |
//init laravel | |
require __DIR__.'/../../bootstrap/autoload.php'; |