This file contains 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
newUrl = generateUserFriendlyUrl($('#filter_form').serialize(), d.start, d.length, d.order[0]['column'], d.order[0]['dir']); | |
window.history.pushState({id: 'my_report'}, null, "/reports/some_report/" + newUrl); |
This file contains 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
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script> | |
<script src="https://momentjs.com/downloads/moment.js"></script> | |
<script> | |
$(document).ready(function() { | |
function getRandomMilisecond(min, max) | |
{ | |
var randomMinute = Math.floor(Math.random() * (max - min + 1)) + min; | |
return randomMinute * 60000; // 1 min = 60000 mls | |
} |
This file contains 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
CREATE TABLE `post` ( | |
`id` int(11) NOT NULL, | |
`name` varchar(100) NOT NULL | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8; | |
//---------------------------------------- | |
SELECT id, name FROM post WHERE id IN (SELECT id FROM post GROUP BY id having count(id) > 1) ORDER BY id; |
This file contains 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 | |
$string = 'This is (ok)'; | |
function bracketValidation($string) | |
{ | |
$counter = 0; | |
$openBracket = ['(','{','[']; | |
$closedBracket = [')','}',']']; |
This file contains 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 | |
namespace App\Http\Controllers\Backend; | |
use App\Http\Controllers\Controller; | |
use App\Model\Commondata; | |
use Illuminate\Http\Request; | |
use App\Http\Requests\CommondataRequest; | |
class CommondataController extends Controller |
This file contains 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
public static function boot() | |
{ | |
parent::boot(); | |
self::deleting(function($model) { | |
if($model->default == 1) | |
return false; | |
}); | |
self::updated(function($model){ |
This file contains 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
try { | |
// send email | |
} | |
catch (Swift_TransportException $e) { | |
// delete email | |
} |
This file contains 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
public function actionSearch() | |
{ | |
// ---------SphinxSearch---------- | |
if($_SERVER['REQUEST_METHOD'] == 'GET') | |
{ | |
$searchText = HtmlPurifier::process(Yii::$app->request->get('search')); | |
$searchText = trim($searchText); | |
$sphinxQuery = new Query(); | |
$sphinxResult = $sphinxQuery->from('post_index')->match($searchText)->all(); |
This file contains 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
$key = 'password to (en/de)crypt'; | |
$string = ' string to be encrypted '; // данные для шифровки/дешифровки | |
/////////////// Шифрование ////////////////// | |
$iv = mcrypt_create_iv( | |
mcrypt_get_iv_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC), | |
MCRYPT_DEV_URANDOM | |
); | |
$encrypted = base64_encode( |
This file contains 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 | |
include_once('simple_html_dom.php'); | |
// %progdir%\modules\wget\bin\wget.exe -q --no-cache http://forexfactory.loc/forexfactory.php | |
define ("PATH_TO_FOLDER", "C:/Users/Vadim/AppData/Roaming/MetaQuotes/Terminal/D0E8209F77C8CF37AD8BF550E51FF075/MQL5/Files/"); | |
// define ("PATH_TO_FOLDER", "E:/openserver522/openserver/domains/forexfactory.loc/"); | |
define ("CSV_FILE_NAME", "forexfactoryparce.csv"); | |
if(!file_exists(PATH_TO_FOLDER.CSV_FILE_NAME)) |
NewerOlder