Skip to content

Instantly share code, notes, and snippets.

View doulmi's full-sized avatar

CHEN Fengyu doulmi

  • French
View GitHub Profile
<?php
namespace Tests;
use Illuminate\Foundation\Testing\TestCase as BaseTestCase;
use Tymon\JWTAuth\Facades\JWTAuth;
use ReflectionClass;
abstract class TestCase extends BaseTestCase
{
<?php
namespace Tests\Feature;
use App\Models\CartItem;
use App\Models\Sku;
use App\Models\Spu;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
use App\Models\User;
@doulmi
doulmi / default.conf
Created March 24, 2018 15:40
NGiNX Configuration for Vue-Router in HTML5 Mode
server {
listen 80 default_server;
listen [::]:80 default_server;
root /your/root/path;
index index.html;
server_name you.server.com;
@doulmi
doulmi / Laraval way to read lines from a file
Last active November 30, 2017 15:44
Laraval way to read lines from a file
/**
* Read lines from the file, auto detecting line endings.
*
* @param string $filePath
*
* @return array
*/
protected function readLinesFromFile($filePath)
{
// Read file into an array of lines with auto-detected line endings
@doulmi
doulmi / download
Last active November 30, 2017 15:44
Laravel download formated json file
$aides = Aide::all();
File::put('aides/aides.json', $aides->toJson(JSON_PRETTY_PRINT));
return response()->download('aides/aides.json', 'aides.json');
@doulmi
doulmi / Laravel Active menubar js.php
Created August 14, 2017 07:29
Laravel Active menubar js
// Set active state on menu element
var current_url = "{{ Request::fullUrl() }}";
var full_url = current_url+window.location.search;
var $navLinks = $("ul.sidebar-menu li a");
// First look for an exact match including the search string
var $curentPageLink = $navLinks.filter(
function() { return $(this).attr('href') === full_url; }
);
// If not found, look for the link that starts with the url
if(!$curentPageLink.length > 0){
@doulmi
doulmi / download_all_branches.sh
Created June 23, 2017 14:16
Download All branches
#!/bin/bash
set -x #echo on
remote_url=$(git config --get remote.origin.url)
for branch in $(git branch --all | grep '^\s*remotes' | egrep --invert-match '(:?HEAD|master)$'); do
branch_name=$(echo $branch| cut -d'/' -f 3)
git clone -b $branch_name $remote_url $branch_name
done
@doulmi
doulmi / Bienvenu.php
Created June 21, 2017 07:50
Bienvenu.php
<?php
namespace App\Console\Commands;
use Carbon\Carbon;
use Illuminate\Console\Command;
require_once app_path('simple_html_dom.php');
class FrDown extends Command
@doulmi
doulmi / RFI Downloader.php
Created June 21, 2017 07:49
RFI Downloader.php
<?php
namespace App\Console\Commands;
use Carbon\Carbon;
use Exception;
use Illuminate\Console\Command;
require_once app_path('simple_html_dom.php');
@doulmi
doulmi / iphone_disable_autozoom_input.css
Last active May 31, 2017 07:39 — forked from vedranjaic/iphone_disable_autozoom_input.css
css: iPhone - Disable auto-zoom on input fields
/*
* disable auto-zoom on iphone input field focus
* http://www.456bereastreet.com/archive/201212/ios_webkit_browsers_and_auto-zooming_form_controls/
*/
input[type='text']:focus,
input[type='number']:focus,
textarea:focus {
font-size: 16px;
}