Skip to content

Instantly share code, notes, and snippets.

View jenky's full-sized avatar
✈️
fly away!

Lynh jenky

✈️
fly away!
  • 21.0228148,105.7957639
View GitHub Profile
(function( $ ) {
$.fn.photoswipe = function(options){
var galleries = [],
_options = options;
var init = function($this){
galleries = [];
$this.each(function(i, gallery){
galleries.push({
id: i,
@jenky
jenky / app.blade.php
Last active March 28, 2016 01:44
Laravel Admin LTE
@extends('layouts.base')
@section('css')
{!! Html::style(cache_buster('css/vendor.css')) !!}
{!! Html::style(cache_buster('css/app.css')) !!}
@endsection
@section('js')
{!! Html::script(cache_buster('js/vendor.js')) !!}
{!! Html::script(cache_buster('js/app.js')) !!}
.btn-file {
position: relative;
overflow: hidden;
}
.btn-file input[type=file] {
position: absolute;
top: 0;
right: 0;
min-width: 100%;
@jenky
jenky / PushNotification.php
Last active August 16, 2016 04:07
Laravel push notification job based on modified version of https://github.com/davibennun/laravel-push-notification package
<?php
namespace App\Jobs;
use App\Contracts\PushNotification as Pusher;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use Sly\NotificationPusher\Collection\DeviceCollection;
use Sly\NotificationPusher\Model\Device;
@jenky
jenky / .php_cs
Last active July 12, 2018 08:18
Laravel PHP-CS-Fixer 2 config
<?php
$finder = PhpCsFixer\Finder::create()
->exclude('bootstrap/cache')
->exclude('storage')
->exclude('vendor')
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
@jenky
jenky / gist:d88ea8c32dd758f929d973450628218a
Created December 7, 2016 08:13
Use phpunit command without vendor/bin
alias phpunit="vendor/bin/phpunit"
@jenky
jenky / InputNumber.vue
Created February 27, 2018 08:00
Vue input number
<template>
<div :class="wrapperClass">
<div slot="minus" :class="[buttonClass, 'minus']" @click.prevent="decreaseNumber">-</div>
<input type="text"
:value="numericValue"
@keypress="validateInput"
@change="updateValue($event.target.value)"
:class="inputClass"
:min="min"
:max="max"
@jenky
jenky / GeoDistance.php
Created June 28, 2018 17:02
Eloquent trait to find nearest results based on Latitude and Longitude
<?php
namespace App\Models\Traits;
trait GeoDistance
{
/**
* Filter results by nearest latitude and longitude.
*
* @param \Illuminate\Database\Eloquent\Builder $query
@jenky
jenky / AuthorizesMultipleGuard.php
Last active September 6, 2018 11:47
Authorizes multiple guard in policy
<?php
namespace App\Policies;
use Illuminate\Foundation\Auth\User;
use Illuminate\Support\Str;
trait AuthorizesMultipleGuard
{
protected function authorizeFor(User $user, ...$args)
@jenky
jenky / AuthorizesMultipleGuard.php
Created November 28, 2018 04:20
Authorize multiple guard in policy
<?php
namespace App\Policies;
use Illuminate\Foundation\Auth\User;
use Illuminate\Support\Str;
trait AuthorizesMultipleGuard
{
protected function authorizeFor(User $user, ...$args)