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 | |
/** | |
* Get Git Status via PHP (No execute function) | |
* @author Nimit Suwannagate <ethaizone@hotmail.com> | |
* Laravel Version | |
*/ | |
function getGitStatus() | |
{ | |
$branch = null; |
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 | |
if (! function_exists('view')) | |
{ | |
/** | |
* Render view as html with layout system | |
* @author Nimit Suwannagate <ethaizone@hotmail.com> | |
*/ | |
function view($viewName, $data = array(), $layout = 'default') | |
{ |
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 | |
if ( ! function_exists('basePath')) | |
{ | |
/** | |
* Get the path to the base of the install. | |
* | |
* @param string $path | |
* @return string | |
*/ |
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 | |
// write by me. | |
if ( ! function_exists('dq')) | |
{ | |
function dq($offset = 0, $length = null, $echoOnly = false) | |
{ | |
s(array_slice(DB::getQueryLog(), $offset, $length)); | |
if ($echoOnly == false) |
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 | |
/** | |
* Date function for Thai | |
* Lazy code version. | |
* | |
* Don't remove copyright. | |
* | |
* @author Nimit Suwannagate <ethaizone@hotmail.com> | |
*/ |
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 | |
use Illuminate\Foundation\Testing\DatabaseMigrations; | |
class ProductControllerTest extends TestCase | |
{ | |
use DatabaseMigrations; | |
protected $testSubject = null; |
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 | |
/** | |
* write by EThaiZone <ethaizone@hotmail.com> | |
* todo feature - about update data of pivot table | |
*/ | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Database\Eloquent\Builder; |
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
var res = {0:0,1:0}; | |
var r; | |
for(var i = 0; i < 100; i++) { | |
r = Math.floor((Math.random() * 2) + 0); | |
res[r]++; | |
} | |
console.log(res); |
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 | |
use Redis; | |
use Exception; | |
/** | |
* Redis cache - Port from Phalcon Cache | |
* Cut intergate from backend and front cache | |
* I don't test or try run it. This pass on php linter. | |
* When I want to use it, I will check later. |
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 | |
/** | |
* Code demo for convert base number with custom base character map. | |
* Not support negative number. | |
*/ | |
// base from toHex on http://hashids.org/ | |
function intToChar($input) | |
{ |
OlderNewer