Skip to content

Instantly share code, notes, and snippets.

@solepixel
solepixel / movie-calendar.md
Last active January 6, 2025 01:29
365 Days of Movies - A work in progress. Each day corresponds with a date mentioned or relevant in the movie.

365 Days of Movies

January 1 - Rocky

January 6 - Sherlock Holmes

January 11 - Goodfellas

January 20 - The Fugitive

@solepixel
solepixel / serializeObject.js
Last active October 26, 2018 19:03
Serialize form inputs
$.fn.serializeObject = function() {
var arrayData = this.serializeArray(),
objectData = {};
$.each( arrayData, function() {
var value;
if ( this.value != null ) {
value = this.value;
} else {
@solepixel
solepixel / wp-config.php
Created December 20, 2018 14:38
Enable WP_DEBUG on production sites - Only do this temporarily to find problems. Disable and delete wp-content/debug.log when you've resolved your issue.
<?php
// ^^ Other config settings such as database credentials. ^^
/**
* WordPress debugging mode.
*
* For information on other constants that can be used for debugging,
* visit the Codex.
*
@solepixel
solepixel / gf-custom-validation.php
Last active February 25, 2020 04:19
Fixes Gravity Forms Custom Validation Message
<?php
add_filter( 'gform_field_validation', 'mytheme_fix_custom_validation', 10, 4 );
/**
* Fixes Gravity Forms Custom validation message.
*
* @link https://docs.gravityforms.com/gform_field_validation/
*
* @param array $result The result array.
@solepixel
solepixel / folder-structure.txt
Last active January 30, 2020 01:43
This is my go-to package.json and gulpfile.js templates
PROJECTNAME/
| bin -- Can be excluded from project distribution.
| images/ -- Images added here will be optimized.
| sass/
| blocks/
| BLOCKNAME/ -- SCSS files for BLOCKNAME.
| BLOCKNAME.scss -- Repeat for all blocks needed.
| PROJECTNAME.scss
| PROJECTNAME-admin.scss
| editor-styles.scss -- Admin editor specific styles.
@solepixel
solepixel / .htaccess
Created May 27, 2022 16:08
.htaccess Redirect All URLs from one domain to another
# Redirect Requests to Live Site.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} ^stagingsite.net$ [NC]
RewriteRule ^(.*)$ https://livesite.com/$1 [R=301,L]
</IfModule>