Skip to content

Instantly share code, notes, and snippets.

@bert-w
bert-w / app\Console\Commands\RepeatCommand.php
Created May 30, 2023 20:29
Repeat Laravel commands every (few) second(s)
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Artisan;
class RepeatCommand extends Command
{
protected $signature = 'repeat-command
@bert-w
bert-w / bricklink-mod.user.js
Last active October 8, 2020 11:50
BrickLinkMod
@bert-w
bert-w / search.php
Created March 21, 2019 22:05
Find a high multiplicative persistence in PHP
<?php
// INPUT VARS
$start = 2677889;
$end = 26888999;
/**
* @param integer $input
* @return false|int
*/
@bert-w
bert-w / .htaccess
Last active May 17, 2019 22:05
Generic htaccess rewrite to HTTPS
# Rewrite non-https to https + www
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://www.%1%{REQUEST_URI} [L,NE,R=301]
</IfModule>
# Rewrite non-https to https without www
@bert-w
bert-w / helpers.scss
Last active June 30, 2017 13:07
SCSS/SASS helpers for padding & margin classes
$type: (p:padding, m:margin);
$position: (t:top, l:left, b:bottom, r:right);
$range: 0 5 10 15 20 25 30 35 40;
/*
* Loop and create classes that serve as quick padding/margin modifiers.
* Explanation of class syntax:
*
* ".p-t-0" Assign a padding-top of 0px (!important).
* ".m-b-35" Assign a margin-bottom of 35px (!important).