Skip to content

Instantly share code, notes, and snippets.

View skoskie's full-sized avatar

Shelton Koskie skoskie

View GitHub Profile
@mahdyar
mahdyar / AllowedUsername.php
Last active May 5, 2024 19:18
Prevent your users to register with your route paths like login, or reserved usernames as their usernames in Laravel. More: https://blog.mahdyar.me/2021/04/18/route-paths-and-reserved-usernames-in-laravel/
<?php
namespace App\Rules;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Support\Facades\Route;
class AllowedUsername implements Rule
{
/**
@rosswintle
rosswintle / spam-pixel.php
Created March 26, 2021 10:23
WordPress Spam Pixel code for WP Forms
<?php
/**
* Plugin Name: Spam Pixel
* Description: This simple plugin integrates Ross's spam pixel idea with WP Forms
* Author: Ross Wintle
* Author URI: https://rosswintle.uk
* Text Domain: spam-pixel
* Domain Path: /languages
* Version: 0.1.0
*

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@maxandersen
maxandersen / threaded.plist
Last active December 11, 2023 05:55
Threaded view for recent versions of mailmate. Put this in `~/Library/Application Support/MailMate/Resources/Layouts/Mailboxes/threaded.plist` and enable it via `View > Layout > Threaded`
{
name = "Threaded";
rootViewer =
{
viewerType = "MmSplitView";
orientation = "horizontal";
children =
(
{
viewerType = "MmBoxView";
@ChristopherA
ChristopherA / brew-bundle-brewfile-tips.md
Last active September 15, 2024 22:35
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@rosswintle
rosswintle / wordpress-cleanup.php
Created February 1, 2019 17:04
WordPress Cleanup hooks
<?php
/**
* Plugin Name: Wordpress Cleanup
*/
namespace WordPress_Cleanup;
/**
* Change filters here to control what this does
*/
@lbngoc
lbngoc / wpcli-cheat-sheet.md
Last active April 16, 2024 12:45
WP-CLI Reference Cheat Sheet

Quick mysql notes

mysql -u myawesomeusername -p
mysql> create database thisismy\_databasename;
mysql> grant all on thisismy\_databasename.\* to 'thisismy\_username' identified by 'ApasswordBetterThanThis';

In a nutshell

@werrpy
werrpy / rclone.conf
Last active May 19, 2021 21:27
rclone Unlimited Cloud Storage Script (Google Drive)
[media-local-secret]
type = crypt
remote = secret/media
filename_encryption = standard
password =
password2 =
[media-remote-secret]
type = crypt
remote = gdrive:path/to/media
<?php
namespace Acme\Demo\Models;
use Model;
use October\Rain\Database\Pivot;
use Backend\Facades\BackendAuth;
class CategorizablePivot extends Pivot
{
@alexwoollam
alexwoollam / function.php
Last active March 10, 2022 00:29 — forked from mattclements/function.php
Wordpress Disable Comments (add to function.php)
<?php
/**
* Disables comments, Add below to existing function.php file.
*/
/** Disable support for comments and trackbacks in post types. */
function df_disable_comments_post_types_support() {
$post_types = get_post_types();
foreach ( $post_types as $post_type ) {
if ( post_type_supports( $post_type, 'comments' ) ) {