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 | |
function createDateRangeArray($strDateFrom,$strDateTo) | |
{ | |
// takes two dates formatted as YYYY-MM-DD and creates an | |
// inclusive array of the dates between the from and to dates. | |
// could test validity of dates here but I'm already doing | |
// that in the main script | |
$aryRange=array(); |
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 | |
if (!file_exists('path/to/directory')) { | |
mkdir('path/to/directory', 0777, true); | |
} |
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 | |
function pw_add_image_sizes() { | |
add_image_size( 'pw-thumb', 300, 100, true ); | |
add_image_size( 'pw-large', 600, 300, true ); | |
} | |
add_action( 'init', 'pw_add_image_sizes' ); | |
function pw_show_image_sizes($sizes) { | |
$sizes['pw-thumb'] = __( 'Custom Thumb', 'pippin' ); | |
$sizes['pw-large'] = __( 'Custom Large', 'pippin' ); |
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 | |
namespace App\Extentions; | |
use DB; | |
use Log; | |
use Illuminate\Validation\Validator; | |
class CustomValidation extends Validator { |
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
error: function (request) { | |
// Validation error would return 422 header | |
if (request.status == 422) { | |
// Parser the json response expected | |
var $errors = $.parseJSON(request.responseText); | |
// Bootstrap alert scafolding for error | |
var errorsHtml = '<div class="alert alert-danger alert-dismissible"><button aria-hidden="true" data-dismiss="alert" class="close" type="button">×</button><h4><i class="icon fa fa-times"></i>Opps! Seems like you didn\'t fill the form properly...</h4><ul>'; | |
// The root nodes are field names, with an array of error messages | |
$.each( $errors, function( key, value ) { | |
// We loop through the error to see if there are multiple error associated with the field |
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 | |
/** | |
* Get the validator instance for the request and | |
* add attach callbacks to be run after validation | |
* is completed. | |
* | |
* @return \Illuminate\Contracts\Validation\Validator | |
*/ | |
protected function getValidatorInstance() | |
{ |
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 | |
namespace Sworup\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Symfony\Component\Finder\Finder; | |
class AppServiceProvider extends ServiceProvider | |
{ | |
public function boot() | |
{ | |
} |
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
npm WARN deprecated [email protected]: ReDoS vulnerability parsing Set-Cookie https://nodesecurity.io/advisories/130 | |
npm WARN deprecated [email protected]: use uuid module instead | |
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue | |
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue | |
npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue | |
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree. | |
npm WARN prefer global [email protected] should be installed with -g | |
npm WARN prefer global [email protected] should be installed with -g | |
npm WARN prefer global [email protected] should be installed with -g |
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 | |
use Illuminate\Support\Facades\Log; | |
\DB::listen(function($sql, $bindings, $time) { | |
Log::info($sql); | |
Log::info($bindings); | |
Log::info($time); | |
}); | |
// Your query goes after this |
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 | |
function w1250_to_utf8($text) { | |
// map based on: | |
// http://konfiguracja.c0.pl/iso02vscp1250en.html | |
// http://konfiguracja.c0.pl/webpl/index_en.html#examp | |
// http://www.htmlentities.com/html/entities/ | |
$map = array( | |
chr(0x8A) => chr(0xA9), | |
chr(0x8C) => chr(0xA6), |
OlderNewer