Skip to content

Instantly share code, notes, and snippets.

@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active October 6, 2024 19:59
Multisite: Passwort Reset on Local Blog
<?php
/**
* Plugin Name: Multisite: Passwort Reset on Local Blog
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Version: 1.0.0
* Author: Eric Teubert
* Author URI: http://ericteubert.de
* License: MIT
*/
<?php
/**
* Plugin Name: WooCommerce Settings Tab Demo
* Plugin URI: https://gist.github.com/BFTrick/b5e3afa6f4f83ba2e54a
* Description: A plugin demonstrating how to add a WooCommerce settings tab.
* Author: Patrick Rauland
* Author URI: http://speakinginbytes.com/
* Version: 1.0
*
* This program is free software: you can redistribute it and/or modify
@pommiegranit
pommiegranit / base.twig
Last active May 31, 2021 18:50
Timber + Twig Examples
{% import 'twig/macros.twig' as macros %}
{{ function( 'get_header' ) }}
<div id="primary" class="content-area">
<div id="main" class="site-main" role="main">
{% block content %}{% endblock %}
</div><!-- #main -->
@staltz
staltz / introrx.md
Last active April 19, 2025 05:15
The introduction to Reactive Programming you've been missing
@Eworm
Eworm / gulpfile.js
Created June 1, 2014 07:48
Gulpfile with SCSS lint
var gulp = require('gulp');
// Get packages from package.json
var plugins = require("gulp-load-plugins")();
// Livereload stuff
lr = require('tiny-lr'),
server = lr();
@Eworm
Eworm / .scss-lint.yml
Last active August 29, 2015 14:01
SCSS lint preferences
linters:
Indentation:
enabled: true
width: 4
EmptyRule:
enabled: false
PropertySortOrder:
@thagxt
thagxt / AJAX add to cart button on Shop page in WooCommerce.php
Created April 3, 2014 14:27
AJAX add to cart button on Shop page in WooCommerce
WTF: Get the AJAX add to cart button on Shop/Category/Search pages in WooCommerce. (AJAX works only for simple products)
HOW:
1) create a directory, name it "woocommerce" put it in your theme root.
2) copy/pasta from woocommerce plugin directory the content-product.php file
3) at the end of the (content-product.php) file, paste the code below:
<?php
global $product;
echo apply_filters( 'woocommerce_loop_add_to_cart_link',
var gulp = require('gulp');
// Get packages from package.json
var tasks = require("gulp-load-tasks")();
// Livereload stuff
lr = require('tiny-lr'),
server = lr();
@L422Y
L422Y / osx_automount_nfs.md
Last active March 31, 2025 20:26
Automounting NFS share in OS X into /Volumes

I have spent quite a bit of time figuring out automounts of NFS shares in OS X...

Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:

/etc/auto_master (see last line):

#
# Automounter master map
#

+auto_master # Use directory service

@claudiosanches
claudiosanches / functions.php
Created January 9, 2014 16:32
WooCommerce 2.1 - Extra fields in WooCommerce registration.
<?php
/**
* Add new register fields for WooCommerce registration.
*
* @return string Register fields HTML.
*/
function cs_wc_extra_register_fields() {
?>
<p class="form-row form-row-first">
<label for="reg_billing_first_name"><?php _e( 'Nome', 'textdomain' ); ?> <span class="required">*</span></label>