Skip to content

Instantly share code, notes, and snippets.

@statickidz
statickidz / functions.php
Last active February 24, 2024 04:35
Woocommerce - Show Custom Filter and Admin Column for Catalog Visibility
<?php
/**
* @snippet Show Custom Filter and Admin Column for Catalog Visibility @ WooCommerce Products Admin
* @sourcecode https://gist.github.com/statickidz/6a539550d8e0d13d2c3d12318672e816
* @author Adrián Barrio Andrés (statickidz.com)
*/
add_filter('woocommerce_product_filters', 'skidz_filter_by_catalog_visibility_dashboard_products');
@jgarciaruiz
jgarciaruiz / Added my custom column hpd
Created October 19, 2015 17:11
Add custom field column to WC products admin table
/* WC HPD */
//manage_product_posts_custom_column
add_filter( 'manage_edit-product_columns', 'products_customcol_fn' );
function products_customcol_fn($columns){
$new_columns = (is_array($columns)) ? $columns : array();
$new_columns['HPD'] = 'hpd';
return $new_columns;
}
add_action( 'manage_product_posts_custom_column', 'products_customcol_value_fn', 2 );
@TylerFisher
TylerFisher / hosting-on-github.md
Last active July 21, 2024 05:51
Basic steps for hosting on Github

Hey there, apparently people are still using this Gist from 2013! It's out of date! Consult the Github docs.

Steps for Hosting a Website on GitHub

  1. Create a GitHub account on github.com.
  2. Download either [GitHub for Mac][1] or [GitHub for Windows][2], depending on your operating system. Open the app and log in using the account you just created.
  3. (On Mac): After you login, click advanced and make sure that your name and email are correct. Then, click "Install Command Line Tools", just in case you want to start using the command line later in life.
  4. Create a new repository in your GitHub application. Name it your-username.github.io. The name is very important. Note the folder that GitHub is saving the repository to. Make sure the "Push to GitHub?" box is checked.
  5. Move your website's files into the folder that GitHub just created when you made the repository. IMPORTANT: Your homepage HTML file must be called "index.html", and it must exist in the top-level
@janfabry
janfabry / on-demand-resize.php
Created November 13, 2010 16:03
WordPress On-Demand image resizer plugin (first public attempt)
<?php
/*
Plugin Name: On-Demand image resizer
Plugin URI: http://www.monkeyman.be
Description: Create and store images in different sizes on demand
Version: 1.0
Author: Jan Fabry
This plugins monitors 404 requests to the uploads directory and created new images of a requested size. They are saved as new files in the upload directory, not cached somewhere, so future requests are served directly by the server. This allows you to eliminate the creation of intermediate image sizes [see monkeyman-virtual-intermediate-images] or resize images based on the size used in the editor [see monkeyman-resize-image-tags].
@diodoe
diodoe / resize_image_by_window.js
Created October 15, 2010 14:39
Resize image based on the window size (jQuery)
//Adjust image size
//needs jquery
//put a #grid and #resizeme on your html and call $('#resizeme').resizeimg()
$.fn.resizeimg = function() {
//Define starting width and height values for the original image
var startwidth = 1280;
var startheight = 960;
//Define image ratio
var ratio = startheight/startwidth;
//Gather browser dimensions