Skip to content

Instantly share code, notes, and snippets.

View sidis405's full-sized avatar

Sidrit Trandafili sidis405

View GitHub Profile
@brunocfalcao
brunocfalcao / gist:fd8981b1c698aa0f4c86346f0ccc1dce
Last active December 11, 2020 15:39
Show the breakpoint name in your tailwind webpage
<div class="bg-red-500 sm:bg-teal-500 md:bg-yellow-500 lg:bg-indigo-500 xl:bg-orange-500 fixed flex items-center inset-0 opacity-75 h-8 w-32 mx-auto z-50">
<div class="text-center block mx-auto sm:hidden md:hidden lg:hidden xl:hidden">DEFAULT</div>
<div class="text-center hidden mx-auto sm:block md:hidden lg:hidden xl:hidden">SM</div>
<div class="text-center hidden mx-auto sm:hidden md:block lg:hidden xl:hidden">MD</div>
<div class="text-center hidden mx-auto sm:hidden md:hidden lg:block xl:hidden">LG</div>
<div class="text-center hidden mx-auto sm:hidden md:hidden lg:hidden xl:block">XL</div>
</div>
@jlem
jlem / Member.php
Created August 25, 2015 03:19
Eloquent model caching
<?php
class Member extends Model implements CurrentMember
{
use ModelCache;
public function getLeaguePlayer(SectionInterface $section)
{
return $this->cache(function(SectionInterface $section) {
return $this->leaguePlayers()
->where('section_id', $section->getID())
@frzsombor
frzsombor / gist:ddd0e11f93885060ef35
Last active December 7, 2023 00:05
Share Laravel's session and check authentication from external projects
<?php
/*
|--------------------------------------------------------------------------
| Sharing Laravel's session and checking authentication
|--------------------------------------------------------------------------
|
| Use the following code in any CMS (WordPress, Joomla, etc), filemanager (CKFinder,
| KCFinder, simogeos's Filemanager, etc), or any other non-Laravel project to boot into
| the Laravel framework, with session support, and check if the user is authenticated.
@franquis
franquis / PostController.php
Last active February 4, 2023 03:12
Summernote image upload with PHP (Laravel + Intervention\lmage)
<?php
/**
* This exemple shows how to parse base64 encoded images (submitted using Summernote), save them locally
* and replace the 'src' attribute in the submited HTML content
*
**/
use Intervention\Image\ImageManagerStatic as Image;
class PostController {
public function edit(){
@bhays
bhays / Typeahead-BS3-css
Created August 2, 2013 13:54
Bootstrap 3 style fixes for using Typeahead.js
.twitter-typeahead .tt-query,
.twitter-typeahead .tt-hint {
margin-bottom: 0;
}
.tt-hint {
display: block;
width: 100%;
height: 38px;
padding: 8px 12px;
font-size: 14px;