Skip to content

Instantly share code, notes, and snippets.

View Leland's full-sized avatar
:shipit:
ship't

Leland Clemmons Leland

:shipit:
ship't
View GitHub Profile
@joostvanveen
joostvanveen / delete_customers_and_orders_from_magento.sql
Last active September 16, 2021 19:07
Delete all customers and orders from Magento 1*
--
-- This query delelets all customers and orders from your
-- Magento 1.* install. Handy, if you have a bloated
-- Magento database and you need to do a bit
-- of cleaning up for use on a local machine.
--
-- Replace PREFIX_ with your current Magento table prefix.
--
-- USE AT OWN RISK. ALWAY BACKUP YOUR DATABASE FIRST.
--
/**
* Creates a preload link pointing to myFonts' licence counting url. This
* allows hits to the site to register as font requests with myFonts, but
* ensures that we are not blocking CSS rendering by waiting for this request
* to complete.
*
* This avoids having to include the following in a CSS file:
* @import url("//hello.myfonts.net/count/<id>");
*
* Refs:
@devinsays
devinsays / example-ajax-enqueue.php
Last active October 4, 2023 13:09
Simple WordPress Ajax Example
<?php
function example_ajax_enqueue() {
// Enqueue javascript on the frontend.
wp_enqueue_script(
'example-ajax-script',
get_template_directory_uri() . '/js/simple-ajax-example.js',
array( 'jquery' )
);
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active December 15, 2023 09:11
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@jkubecki
jkubecki / ExportKindle.js
Last active February 25, 2024 00:45
Amazon Kindle Export
// The following data should be run in the console while viewing the page https://read.amazon.com/
// It will export a CSV file called "download" which can (and should) be renamed with a .csv extension
var db = openDatabase('K4W', '3', 'thedatabase', 1024 * 1024);
getAmazonCsv = function() {
// Set header for CSV export line - change this if you change the fields used
var csvData = "ASIN,Title,Authors,PurchaseDate\n";
db.transaction(function(tx) {
@katylava
katylava / git-selective-merge.md
Last active February 27, 2024 10:18
git selective merge

Update 2022: git checkout -p <other-branch> is basically a shortcut for all this.

FYI This was written in 2010, though I guess people still find it useful at least as of 2021. I haven't had to do it ever again, so if it goes out of date I probably won't know.

Example: You have a branch refactor that is quite different from master. You can't merge all of the commits, or even every hunk in any single commit or master will break, but you have made a lot of improvements there that you would like to bring over to master.

Note: This will not preserve the original change authors. Only use if necessary, or if you don't mind losing that information, or if you are only merging your own work.

@bendc
bendc / easing.css
Created September 23, 2016 04:12
Easing CSS variables
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@sarimarton
sarimarton / crossover-howtocompile.md
Last active April 19, 2024 07:55 — forked from Alex4386/crossover-howtocompile.md
CodeWeavers CrossOver - How to compile from source! for macOS

UPDATE 2023-01-22 21:34:33

This guide was last tested on an Intel MacBook 2017. Since then it's unmaintained and won't be updated (I quit the game and bought a life-time crossover licence).


This has been forked from https://gist.github.com/Alex4386/4cce275760367e9f5e90e2553d655309

For the latest discussion, see the comments there.

@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/