Skip to content

Instantly share code, notes, and snippets.

@leMaur
leMaur / ImportSomething.php
Last active June 29, 2018 13:59
Save `Progressable.php` in `app/Console`. Then use it in your Artisan Commands.
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Console\Progressable;
/**
* .: ATTENTION :.
*
@leMaur
leMaur / invokeTest.php
Last active August 2, 2018 10:55
Copy this file in `Tests\Unit` in a fresh Laravel 5.6 installation.
<?php
namespace Tests\Unit;
use Tests\TestCase;
class invokeTest extends TestCase
{
/** @test */
function expect_an_array()
.toggle {
position: relative;
display: inline-block;
-ms-flex-negative: 0;
flex-shrink: 0;
border-radius: 9999px;
cursor: pointer;
height: 1.5rem;
width: 3rem;
}
@leMaur
leMaur / tabbing.js
Last active September 5, 2019 07:19
(function (window, document) {
'use strict';
let className = 'tabbing';
let handleFirstTab = function (e) {
if (e.keyCode === 9) {
document.body.classList.add(className);
window.removeEventListener('keydown', handleFirstTab);
window.addEventListener('mousedown', handleMouseDownOnce);
@leMaur
leMaur / dpr.js
Last active October 20, 2018 18:54
(function () {
// set default ratio value
let ratio = 1;
// use systemXDPI and logicalXDPI if available
if (window.screen.systemXDPI !== undefined
&& window.screen.logicalXDPI !== undefined
&& window.screen.systemXDPI > window.screen.logicalXDPI) {
(function () {
var oldVersion = "8.17.0";
var newVersion = "10.19.0";
var b = document.getElementsByTagName('body')[0];
var s = document.createElement("script"); s.async = true;
var v = !("IntersectionObserver" in window) ? oldVersion : newVersion;
s.src = "https://cdnjs.cloudflare.com/ajax/libs/vanilla-lazyload/" + v + "/lazyload.min.js";
window.LL = [];
window.addEventListener('LazyLoad::Initialized', function(e){window.LL.push(e.detail.instance)},false);
window.lazyLoadOptions = [
(function () {
[].forEach.call(document.querySelectorAll('img'), function (image) {
if (image.parentNode.tagName == 'NOSCRIPT') {
let _img = new Image();
_img.setAttribute('sizes', image.getAttribute('sizes') || '100vw');
if (image.getAttribute('class')) {
_img.setAttribute('class', image.getAttribute('class'));
}
<script>
export default {
props: {
open: {
type: Boolean,
required: false,
default: false
},
},
@leMaur
leMaur / tailwind.colors.js
Created September 5, 2019 07:04
Custom colors for Tailwindcss taken from Mineral-ui project
// ******************************
// https://mineral-ui.com/color
// ******************************
module.exports = {
colors: {
transparent: 'transparent',
black: '#1d1f24',
white: '#ffffff',
@leMaur
leMaur / tailwind-plugin.grid.js
Last active September 5, 2019 07:18
Basic Grid box
const _ = require('lodash')
module.exports = function ({addBase, addUtilities, e, theme, variants}) {
const gridGaps = theme('gridGap', {})
const gridTemplates = theme('gridTemplate', {})
const gridGapVariants = variants('gridGap', [])
const gridTemplateVariants = variants('gridTemplate', [])
const gapUtilities = _.map(gridGaps, (size, name) => ({
[`.grid-gap-${e(name)}`]: {gridGap: `${size}`},