Skip to content

Instantly share code, notes, and snippets.

@lavoiesl
lavoiesl / subdirectory_loader.php
Last active September 5, 2024 01:41
MU plugins subdirectory loader. Enables the loading of plugins sitting in mu-plugins (as folders)
<?php
/**
* Plugin Name: MU plugins subdirectory loader
* Plugin URI: https://gist.github.com/lavoiesl/6302907
* Description: Enables the loading of plugins sitting in mu-plugins (as folders)
* Version: 0.1
* Author: [email protected]
* Author URI: http://blog.lavoie.sl/
*
@octocat
octocat / .gitignore
Created February 27, 2014 19:38
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
<?php
// This is just a form sample
// Add a new section to WooCommerce > Settings > Products
function add_my_products_section( $sections ) {
$sections['tshirt_designer'] = __( 'T-Shirt Designer', 'my-textdomain' );
return $sections;
}
add_filter( 'woocommerce_get_sections_products', 'add_my_products_section' );
<?php // only copy opening php if needed
/**
* move social login buttons on account form from "login" to "register
*/
function wc_social_login_move_register_buttons() {
if ( function_exists( 'wc_social_login' ) && ! is_admin() ) {
remove_action( 'woocommerce_login_form_end', array( wc_social_login()->get_frontend_instance(), 'render_social_login_buttons' ) );
add_action( 'woocommerce_register_form_end', array( wc_social_login()->get_frontend_instance(), 'render_social_login_buttons' ) );
}
@rudelm
rudelm / autofs.md
Last active November 5, 2024 01:57
Use autofs on Mac OS X to mount network shares automatically during access

Autofs on Mac OS X

With autofs you can easily mount network volumes upon first access to the folder where you want to mount the volume. Autofs is available for many OS and is preinstalled on Mac OS X so I show you how I mounted my iTunes library folder using this method.

Prepare autofs to use a separate configuration file

autofs needs to be configured so that it knows where to gets its configuration. Edit the file /etc/auto_master and add the last line:

#
# Automounter master map
#

+auto_master # Use directory service

@inoperable
inoperable / defaults-export.zsh
Last active November 8, 2024 17:04
export defaults for all domains in macOS into separate .plist files for editing and importing, files are written into $HOME/defaults
#!/usr/bin/env zsh
function exportDefaults {
local outdir="$HOME/defaults"
local outdirApple="$outdir/apple"
local outdirUser="$outdir/user"
local outdirGlobal="$outdir/global"
local filesdone=0
local filecount=0
local filestotal=0
@K4zuki
K4zuki / INSTALL.md
Last active May 22, 2024 08:54
Alpine linux pandoc setup

Should work on Linux/Mac host!

  • use docker
  • add env lines in .bashrc
    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST="tcp://192.168.99.100:2376"
    export DOCKER_CERT_PATH="$HOME\.docker\machine\machines\default"
    export DOCKER_MACHINE_NAME="default"
  • $ docker run alpine:edge /bin/sh
@ridem
ridem / README.md
Last active June 27, 2022 07:37
Download a Shopify store's assets used in your theme

It's hard to migrate section themes that rely heavily on images. This bit of code helps you download all the CDN assets of your theme.

  1. Create a cdn_assets folder
  2. Create the download_assets.js file at the root of your project
  3. Edit the download_assets.js file to match the path to your settings_data.json (line 3)
  4. Edit the download_assets.js file to set the "CDN code" of your store. Each file that you upload from /admin/settings/files gets uploaded with the following format: https://cdn.shopify.com/s/files/1/YOUR_CDN_CODE/files/YOURFILE. The format of the code is /\d{4}\/\d{4}/ (four digits, a forward slash, and four digits)
@ridem
ridem / Download-Shopify-CDN-Assets.md
Last active October 28, 2023 12:15
Download all Shopify CDN assets from a store

Instructions

  1. Go to your Shopify admin/settings/files page
  2. Open your browser Dev tools, go to the console

Then, depending on the option you choose:

Option 1 - Download all the files directly (might crash you browser)

  1. Make sure your browser is set to download files automatically and doesn't ask for the download location every time
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active November 16, 2024 20:24
crack activate Office on mac with license file