Skip to content

Instantly share code, notes, and snippets.

# 5ad638e9477a4de1845f (not found)
<?php
use Illuminate\Foundation\Testing\WithoutMiddleware;
use Illuminate\Foundation\Testing\DatabaseMigrations;
use Illuminate\Foundation\Testing\DatabaseTransactions;
class GetFileName
{
private $keyWord;
<?php
use Mockery as m;
use PayumTW\Allpay\Api;
class ApiTest extends PHPUnit_Framework_TestCase
{
public function tearDown()
{
m::close();
<?php
class PrivateTester
{
public $object;
public function __construct($object)
{
$this->object = $object;
}
@recca0120
recca0120 / JSON.php
Created December 14, 2016 04:25
javascript json decode
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
/**
* Converts to and from JSON format.
*
* JSON (JavaScript Object Notation) is a lightweight data-interchange
* format. It is easy for humans to read and write. It is easy for machines
* to parse and generate. It is based on a subset of the JavaScript
* Programming Language, Standard ECMA-262 3rd Edition - December 1999.
* This feature can also be found in Python. JSON is a text format that is
<?php
/**
* JSMin.php - modified PHP implementation of Douglas Crockford's JSMin.
*
* <code>
* $minifiedJs = JSMin::minify($js);
* </code>
*
* This is a modified port of jsmin.c. Improvements:
*
@recca0120
recca0120 / .php_cs
Created March 27, 2017 12:15
laravel php-cs-fixer 2.1
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'array_syntax' => [
'syntax' => 'short',
],
'binary_operator_spaces' => [
'use babel';
import groupBy from 'lodash/groupBy';
import forEach from 'lodash/forEach';
import axios from 'axios';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/observable/fromPromise';
import 'rxjs/add/observable/fromEvent';
import 'rxjs/add/operator/map';
@recca0120
recca0120 / Session.php
Last active May 3, 2017 16:52
簡單的 session 類別實現
interface SessionInterface {
public function start();
public function set($key, $value);
public function get($key, $default = null);
public function remove($key);
public function all();
}
class NativeSession implemenet SessionInterface {
public function start() {
<?php
namespace App\Http\Middleware;
use Closure;
use Exception;
use Ramsey\Uuid\Uuid;
class RequestId
{