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
Rename Directory | |
git rm -rf --cached path/to/your/directories |
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 | |
#Last Query | |
\DB::enableQueryLog(); | |
// code request | |
$query = \DB::getQueryLog(); | |
$lastQuery = end($query); | |
\Log::info(json_encode($lastQuery)); |
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
<script> | |
(function(){ | |
fetch('/endpoint', {method: 'get'}).then(function (response) { | |
return response.json(); | |
}) | |
.then(function (body) { | |
console.log(body); | |
}); |
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
$(document).on('click', '.pagination a', function (e) { | |
$('.pagination').find('li').removeClass('active disabled'); | |
$(this).parent().addClass('active'); | |
let page = $(this).attr('href').split('page=')[1]; | |
let request = $.ajax({url : 'todo?page=' + page, dataType: 'json'}); | |
request.done(function (res) { | |
// handle res |
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 | |
// Allow from any origin | |
if (isset($_SERVER['HTTP_ORIGIN'])) { | |
// Decide if the origin in $_SERVER['HTTP_ORIGIN'] is one | |
// you want to allow, and if so: | |
header("Access-Control-Allow-Origin: {$_SERVER['HTTP_ORIGIN']}"); | |
header('Access-Control-Allow-Credentials: true'); | |
header('Access-Control-Max-Age: 86400');// cache for 1 day | |
} |
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
// Search recursive | |
array_search($value, array_column($resource, 'key')) |
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
# Get Routes Parameters | |
/** | |
* Get a given parameter from the route. | |
* | |
* @param $name | |
* @param null $default | |
* @return mixed | |
*/ | |
function route_parameter($name, $default = null) |
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
{ | |
"page": 1, | |
"pageSize": 2, | |
"rowCount": 380, | |
"pageCount": 190 | |
} |
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
--- | |
box: laravel/homestead-7 | |
version: 0.2.1 | |
ip: "192.168.10.20" | |
memory: 2048 | |
cpus: 1 | |
name: antifraud | |
provider: virtualbox | |
authorize: ~/.ssh/id_rsa.pub |
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
'use strict'; | |
var gulp = require('gulp'); | |
var path = require('path'); | |
var livereload = require('gulp-livereload'); | |
var API_HTML = 'index.html'; | |
var API_DEST = './public/project/reference/v1'; | |
function raml2html(options) { |