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 | |
$query = Schedule::find(); | |
$query->andWhere(['type' => 4]); | |
$models = $query->all(); | |
var_dump($models); |
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
/bug | |
/*.o |
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 | |
function downloadfiles($url) | |
{ | |
$json = file_get_contents($url); | |
if (!$json) { | |
return false; | |
} | |
//print_r(json_decode($json)); | |
$data = json_decode($json); |
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
static int utox_v4l_fd = -1; | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <stdint.h> | |
#include <string.h> | |
#include <ctype.h> | |
#include <fcntl.h> |
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
#include <CGAL/Simple_cartesian.h> | |
#include <CGAL/Polyhedron_3.h> | |
#include <iostream> | |
#include <string> | |
typedef CGAL::Simple_cartesian<double> Kernel; | |
typedef Kernel::Point_3 Point_3; | |
typedef Kernel::Vector_3 Vector_3; | |
typedef Kernel::Plane_3 Plane_3; |
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
public function actionSuto() | |
{ | |
$identity = UserIdentity::unauthenticatedById($_GET['id']); | |
if ($identity) { | |
Yii::app()->user->login($identity, 0); | |
} | |
$this->redirect(array('/site/index')); | |
} |
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 | |
// require the extension migration file | |
require(__DIR__ . '/../vendor/path/to/extension/migration/yymmsshhiiss_extension_migration.php'); | |
// or if you want to use alias | |
//require(Yii::getAlias('@vendor/path/to/extension/migration/yymmsshhiiss_extension_migration.php')); | |
class yymmsshhiiss_my_extension_migration extends yymmsshhiiss_extension_migration | |
{ | |
// no implementation needed |
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 | |
// assign the value foo to a variable named x | |
$x = "foo"; | |
// assign the value bar to a variable named "x", the name includes the " ;) | |
${'"x"'} = "bar"; | |
// assign the value of a variable, whos name you determine from the content | |
// of the HEREDOC, which is "x" (the name includes the "), to the variable named doc | |
$doc = "${<<<'HERE' | |
"x" |
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 | |
class MyClass extends \yii\base\Component | |
{ | |
private $_value; | |
public function getValue() | |
{ | |
if ($this->_value === null) { | |
$this->_value = /* your sql query here */; |
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 | |
// ... | |
$config['modules']['gii'] = [ | |
'class' => 'yii\gii\Module', | |
'allowedIPs' => ['127.0.0.1', '::1', '192.168.0.*', '192.168.178.20'] // adjust this to your needs | |
]; |