Skip to content

Instantly share code, notes, and snippets.

@MrPunyapal
MrPunyapal / LaravelWhereLikeMacro.php
Last active July 9, 2024 05:11
Laravel Custom 'whereLike' Macro for Dynamic 'LIKE' Searches including relationships
<?php
namespace App\Providers;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Arr;
use Illuminate\Support\ServiceProvider;
class AppServiceProvider extends ServiceProvider
{
@mtx-z
mtx-z / wp-bootstrap5.0-pagination.php
Last active November 15, 2023 00:47
Wordpress 5.7 Bootstrap 5.0 pagination (with custom WP_Query() and global $wp_query support)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* Using Bootstrap 4? see https://gist.github.com/mtx-z/f95af6cc6fb562eb1a1540ca715ed928
*
@denvercoder
denvercoder / roots
Last active February 6, 2023 01:50
My script to setup Roots.io Bedrock and Sage alongside Local by Flywheel
#!/bin/bash
cd ~/Local\ Sites/$1/app/
echo Installing Bedrock... Please Wait
composer create-project roots/bedrock
rm -rf public
@piotrpog
piotrpog / Craft CMS - URL macro
Last active March 4, 2019 14:26
This macro fetches routes into Twig template. More info on http://craftsnippets.com/articles/url-macro
{# v2 #}
{% macro url(routeName, tokens) %}
{% spaceless %}
{% set keyword = 'name' %}
{% set routeString = null %}
{% for route, routeSettings in craft.app.routes.getConfigFileRoutes %}
{% if routeSettings[keyword] is defined and routeSettings[keyword] == routeName %}
{% set routeString = route %}
{% endif %}
@tunguskha
tunguskha / Gradient shadow in pure CSS.md
Last active May 4, 2023 06:40
Gradient shadow in pure CSS

Gradient shadow in pure CSS

alt text

HTML
<button>Let's Go !</button>
@prestarocket
prestarocket / .gitignore
Last active July 19, 2023 16:04
Gitignore PrestaShop 1.7
# Cache, temp and personal files
/.htaccess
*.log
npm-debug.log.*
.sass-cache/
/cache/*
download/*
/img/*
/log/*
@thomasjsn
thomasjsn / laravel-queue.service
Last active April 26, 2024 09:34
Laravel queue worker using systemd.
# Laravel queue worker using systemd
# ----------------------------------
#
# /lib/systemd/system/queue.service
#
# run this command to enable service:
# systemctl enable queue.service
[Unit]
Description=Laravel queue worker
@hsleonis
hsleonis / better-font-smoothing.css
Last active June 13, 2024 18:26
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
@matchaxnb
matchaxnb / regenerate-images.php
Created May 20, 2015 14:56
Regenerate images in Prestashop from command line
<?php
define('_PS_ROOT_DIR_', '/path/to/prestashop/root');
define('_PS_ADMIN_DIR_', _PS_ROOT_DIR_.'admin_folder');
require(_PS_ADMIN_DIR_.'/../config/config.inc.php');
require(_PS_ADMIN_DIR_.'/functions.php');
class Employee2 extends EmployeeCore
{
public function isSuperAdmin()
@paulirish
paulirish / bling.js
Last active July 23, 2024 14:51
bling dot js
/* bling.js */
window.$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function (name, fn) {
this.addEventListener(name, fn);
};
NodeList.prototype.__proto__ = Array.prototype;