Skip to content

Instantly share code, notes, and snippets.

View jonlimitless's full-sized avatar

Jon Limitless jonlimitless

View GitHub Profile
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@jonathonbyrdziak
jonathonbyrdziak / example.php
Created February 22, 2012 02:27
Wordpress Metabox, stand alone class for multiple metabox abilities
<?php
/*
Here's a couple of metaboxes that I've recently created using this system
*/
$subpostings = redrokk_metabox_class::getInstance('subpostings', array(
'title' => '(optional) Subscription for Postings',
'description' => "As an optional feature, you have a complete api at your disposal which will allow you the ability to offer and manage member posts. In addition to these settings, you may need to create the associated pages for accepting posts from your frontend.",
@jonathonbyrdziak
jonathonbyrdziak / taxmeta.class.php
Created February 22, 2012 18:17
Taxonomy Metaboxes, allows you to create additional taxonomy metas, including images.
<?php
/**
* @Author Anonymous
* @link http://www.redrokk.com
* @Package Wordpress
* @SubPackage RedRokk Library
* @copyright Copyright (C) 2011+ Redrokk Interactive Media
*
* @version 2.0
*/
@florinel-chis
florinel-chis / komodo_php_beautifier
Created October 23, 2012 16:59
Macro for Komodo Edit - PHP Beautifier
try {
if (komodo.view.scintilla) { komodo.view.scintilla.focus(); }
var currentPos = komodo.editor.currentPos;
var ke = komodo.editor;
var file = komodo.interpolate('%F');
var php = komodo.interpolate('%(php)');
var script = "/usr/local/zend/bin/php_beautifier"//this can be changed to the path of php_beautifier, install using PEAR
var cmd = script+" --filters='ArrayNested()' "+file; // add options dialog&#63;
StatusBar_AddMessage("Beautifying "+file,"editor",5000,true);
@kloon
kloon / functions.php
Last active July 5, 2023 10:05
WooCommerce add Delete Account button to My Account page This is very dangerous functionality and can cause your whole WordPress installation to break
<?php
// Delete Account Functionality
add_action( 'woocommerce_after_my_account', 'woo_delete_account_button' );
function woo_delete_account_button() {
?>
<a href="<?php echo add_query_arg( 'wc-api', 'wc-delete-account', home_url( '/' ) ) ?>" class="button">Delete Account</a>
<?php
}
add_action( 'woocommerce_api_' . strtolower( 'wc-delete-account' ), 'woo_handle_account_delete' );
@DevinWalker
DevinWalker / woocommerce-optimize-scripts.php
Last active July 10, 2024 09:14
Only load WooCommerce scripts on shop pages and checkout + cart
/**
* Optimize WooCommerce Scripts
* Remove WooCommerce Generator tag, styles, and scripts from non WooCommerce pages.
*/
add_action( 'wp_enqueue_scripts', 'child_manage_woocommerce_styles', 99 );
function child_manage_woocommerce_styles() {
//remove generator meta tag
remove_action( 'wp_head', array( $GLOBALS['woocommerce'], 'generator' ) );
@gabrielmerovingi
gabrielmerovingi / mycred-woo-coupon
Last active June 28, 2020 15:19
This custom shortcode allows your users to convert their myCRED points into a WooCommerce coupon, in order to give themselves a discount or partial payment on their order. In order for this to work, you need to set an exchange rate between points and your store currency and select. Requires myCRED 1.6+ and WooCommerce 2.4+
/**
* Convert myCRED Points into WooCommerce Coupon
* Requires myCRED 1.4 or higher!
* @version 1.3.1
*/
add_shortcode( 'mycred_to_woo_coupon', 'mycred_pro_render_points_to_coupon' );
function mycred_pro_render_points_to_coupon( $atts, $content = NULL ) {
// Users must be logged in
if ( ! is_user_logged_in() )
@SankaD
SankaD / BeutifyJS.js
Last active July 6, 2016 20:58
BeautifyJS for Node.JS
// not sure about the origin, probably https://gist.github.com/adehaas/3693846 Customized version for my liking.
komodo.assertMacroVersion(3);
if (komodo.view.scintilla)
{
komodo.view.scintilla.focus();
} // bug 67103
var koDoc = (komodo.koDoc === undefined ? komodo.document : komodo.koDoc);
var formatter;
var language = koDoc.language;
// ==UserScript==
// @name Fix Dota builds page
// @namespace https://gist.github.com/parnakra/d3720201f66cc64ada7c
// @version 7.00
// @updateURL https://gist.github.com/parnakra/d3720201f66cc64ada7c/raw/
// @downloadURL https://gist.github.com/parnakra/d3720201f66cc64ada7c/raw/
// @description Fixes various issues on the Dota 2 builds page
// @author Parnakra
// @match http://tampermonkey.net/index.php?version=3.11&ext=dhdg&updated=true#features
// @grant none
@williamd1k0
williamd1k0 / demo_markdown.md
Last active February 23, 2021 14:32
Ren'Py - Demo Script Example

Ren'Py language using the pre/code in Markdown

Using pre/code:


```renpy
# Ren'Py statements
```