Skip to content

Instantly share code, notes, and snippets.

@pjobson
pjobson / setup_cypress_wsl2.md
Last active June 28, 2024 14:19
Setting Up Cypress on Ubuntu WSL2
@k1sul1
k1sul1 / wordpress.types.ts
Created April 28, 2020 15:44
Mostly autogenerated type defs for WordPress REST API
// Below: Autogenerated types from Quicktype. They have been modified by hand.
// ACF fields in standard endpoints do not exist out of the box, you have to add them yourself.
// k1sul1/k1kit does that for you automagically.
// To parse this data:
//
// import { Convert, RawStoneData, Texts, Taxonomies, PostTypes, PostStatuses } from "./file";
//
// const taxonomies = Convert.toTaxonomies(json);
// const tags = Convert.toTags(json);
@k1sul1
k1sul1 / build-non-split.js
Created April 1, 2020 14:45
Build create-react-app to a single file. Useful for things like WordPress plugins.
const rewire = require('rewire');
const defaults = rewire('react-scripts/scripts/build.js');
let config = defaults.__get__('config');
config.optimization.splitChunks = {
cacheGroups: {
default: false,
},
};
@k1sul1
k1sul1 / README.md
Last active December 12, 2019 15:16
CircleCI pipeline for WordPress projects running on Seravo/wordpress project template

CircleCI pipeline for WordPress projects running on Seravo/wordpress project template

Builds your theme, installs composer dependencies and deploys it to production / staging.

How?

Create .circleci folder in project root, and add config.yml in it. Edit the config a bit. Use search & replace to substitute $PROD_SSH_PORT to the SSH port number and $THEMENAME to the folder name of your theme.

Login to CircleCI and add a project using the menu in the sidebar. Click "Set Up Project" on the project you want to setup CI for.

@nickkraakman
nickkraakman / ffmpeg-cheatsheet.md
Last active July 9, 2024 12:55
FFmpeg cheat sheet for 360 video

FFmpeg Cheat Sheet for 360º video

Brought to you by Headjack

 
FFmpeg is one of the most powerful tools for video transcoding and manipulation, but it's fairly complex and confusing to use. That's why I decided to create this cheat sheet which shows some of the most often used commands.

 
Let's start with some basics:

  • ffmpeg calls the FFmpeg application in the command line window, could also be the full path to the FFmpeg binary or .exe file
@mieky
mieky / README.md
Created January 8, 2017 08:41
Mike's terminal
@modemlooper
modemlooper / wordpress.json
Last active November 17, 2022 16:07
Config file for Insomnia REST app for WP-API dev - change base_url, username, password and import into app
{
"_type": "export",
"__export_format": 2,
"__export_date": "2016-11-03T03:57:14.655Z",
"__export_source": "insomnia.desktop.app:v3.6.6",
"resources": [
{
"modified": 1477842143375,
"created": 1477841988306,
"parentId": null,
@wkw
wkw / wp-parent-page-filter.php
Created October 25, 2016 18:23
WordPress: allow draft, private posts to be selected in Parent page dropdown
/**
* Show draft and private pages in hierarchicial Parent pages dropdown.
* will work for any hier. post type.
*/
function filter_attributes_dropdown_pages_args($dropdown_args) {
$dropdown_args['post_status'] = array('publish','draft', 'private');
return $dropdown_args;
}
add_filter('page_attributes_dropdown_pages_args', __NAMESPACE__ . '\\filter_attributes_dropdown_pages_args', 100, 1);
@gemmadlou
gemmadlou / remove-visual-composer-shortcodes.md
Last active April 20, 2024 14:56
Removing Visual Composer & Shortcodes From Wordpress Content

Adding @k1sul1's suggestion from the comments as it's more concise than what I had before:

I just wanted them all gone, so I ran this in the MySQL shell.

UPDATE wp_posts SET post_content = REGEXP_REPLACE(post_content, "\\[\/?vc(.*?)\]", "");

Note the double backslash. If you forget it, you'll replace all v's and c's with nothing, and the shortcodes will still be there. This works for other shortcode as well, just replace vc.

@onnimonni
onnimonni / remove-accents-uploaded-files-and-database.php
Last active March 1, 2016 14:34
Run this file with wp-cli: $ wp eval-file remove-accents-uploaded-files-and-database.php to remove accents from all of your previous uploads. Also fix OS-X NFD filenames. After running this command install https://gist.github.com/onnimonni/d58bdcff44f8208a15c7 to your mu-plugins to avoid this in future uploads.
<?php
/**
* Sanitize accents from Cyrillic, German, French, Polish, Spanish, Hungarian, Czech, Greek, Swedish
* This replaces all accents from your uploads by renaming files and replacing attachment urls from database.
* This even removes NFD characters from OS-X by using Normalizer::normalize()
* This is one time script which you can use by running it with wp-cli:
* $ wp eval-file remove-accents-uploaded-files-and-database.php
*/
// Get all uploads