Skip to content

Instantly share code, notes, and snippets.

Avatar

Ivan Pomortsev iworker

View GitHub Profile
View twitter-search
View gist:e595e83f4781d087e999
<?php
namespace console\controllers;
use yii\console\Controller;
use common\models\TestModel;
class LeakController extends Controller
{
private function createModels($detach = true, $count = 10000)
View gist:2998d3fc47aa70d58b21
<?php
namespace common\models;
use yii\db\ActiveRecord;
use yii\behaviors\TimestampBehavior;
class TestModel extends ActiveRecord
{
public function behaviors()
View gist:1769869d86cd84ccf3cd
{
"html_attributions" : [],
"result" : {
"address_components" : [
{
"long_name" : "373",
"short_name" : "373",
"types" : [ "street_number" ]
},
{
@iworker
iworker / dunedin-stadium-small
Last active Aug 29, 2015
Dunedin-stadium-small
View dunedin-stadium-small
{
"formatted_address" : "373 Douglas Avenue, Dunedin, FL 34698, United States",
"geometry" : {
"location" : {
"lat" : 28.00351,
"lng" : -82.786822
}
},
"icon" : "http://maps.gstatic.com/mapfiles/place_api/icons/stadium-71.png",
"id" : "bc141a4d688b00041af65be8593aac94085031fe",
View Benchmark (PHP + data pack)
BSON:
Running benchmark for...
bson
100000 times
Test completed!!
Encoding time: 0.69315004348755
Decoding time: 0.82649397850037
Total time: 1.5196440219879
View gist:4b293549589abecda54d
http://alimero.ru/blog/recepti/blini-drozhzhevie-po-gostu.23875.html
View gist:085106cb7794d51d24a9
<?php
$old = date_default_timezone_get();
date_default_timezone_set('UTC');
$time = time();
$startTime = strtotime('+1 minute ', $time);
$date = date('m/d/Y ', $time);
$start_date = date('h:i A ', $startTime);
$endTime = strtotime('+11 hour 59 minutes ', $startTime);
$end_date = date('h:i A ', $endTime);
You can’t perform that action at this time.