Skip to content

Instantly share code, notes, and snippets.

View flexseth's full-sized avatar

Seth Miller flexseth

View GitHub Profile
@hiranthi
hiranthi / zipcode-2.php
Last active January 17, 2020 00:38
Zipcode validation for Gravity Forms (5 digits, 2 approaches).
<?php
# just add the needed form IDs to the array
$forms = array( '6', '7' );
# looping through the array to add an 'add_filter' for each
foreach ( $forms as $i => $form )
add_filter( "gform_field_validation_{$form}", 'custom_zip_validation', 10, 4 );
# the function
@flexseth
flexseth / wc-wp-product-create.txt
Created September 30, 2018 23:22
wc wp product create options
1/46 [--name=<name>]: Fagor QVR-1 Single Door Reach-in Refrigerator
2/46 [--slug=<slug>]: used-fagor-QVR-1-single-door-reach-in-cooler
3/46 [--type=<type>]:
4/46 [--status=<status>]: draft
5/46 [--featured=<featured>]: y
6/46 [--catalog_visibility=<catalog_visibility>]:
7/46 [--description=<description>]: Only in use for about 2-3 years, still in great shape on the outside and in
8/46 [--short_description=<short_description>]: Came from a lower volume ice cream shop, very little use on this unit and the only we've had in a while. Call (843) 744-2632 - measures 84" tall, 27.5" wide, 31.5" deep
9/46 [--sku=<sku>]:
10/46 [--regular_price=<regular_price>]: 2100
@carasmo
carasmo / unregister-widgets.php
Last active March 24, 2021 13:36
Unregister WordPress, Genesis, and WooCommerce widgets Raw
<?php
//Don't copy above.
add_action('widgets_init', 'cabeymer_unregister_widgets', 10);
/**
* Unregister Various Widgets
* Clean up your widgets.php page
* Single comment out the ones you want to keep
*/
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@monicao
monicao / react.md
Last active February 23, 2021 19:07
React Lifecycle Cheatsheet

React Component Lifecycle

  • getInitialState
  • getDefaultProps
  • componentWillMount
  • componentDidMount
  • shouldComponentUpdate (Update only)
  • componentWillUpdate (Update only)
  • componentWillReceiveProps (Update only)
  • render
<?php
$permalink = 'http://www.youtube.com';
$id = 2;
$title = "My book title";
$pub_date = 'January 15th, 2015';
$city = "New York";
$zipcode = '28475';
$name = 'Bobby';
$like = 'WordPress';
@bzerangue
bzerangue / _verify-repair-permissions-disk.md
Last active June 2, 2024 09:37
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@rnevius
rnevius / wp-installer.sh
Created October 11, 2014 16:37
Shell / SSH WordPress Installer
#!/bin/bash -e
clear
echo ""
echo "============================================="
echo "# #"
echo "# Welcome to the WordPress Installer #"
echo "# #"
echo "============================================="
echo ""
@vivien
vivien / imgur
Last active January 27, 2022 19:46
Shell script to upload image(s) to imgur.com
#!/bin/sh
#
# Upload image(s) to imgur.com
# Copyright (C) 2014 Vivien Didelot <vivien@didelot.org>
# Licensed under GPL version 3, see http://www.gnu.org/licenses/gpl.txt
#
# Requires "jshon":
# http://kmkeen.com/jshon/
#
# Alternatives, which suck: