This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://news.ycombinator.com/item?id=35122780#35123388 | |
# http://karolis.koncevicius.lt/posts/fast_navigation_in_the_command_line/ | |
<<USAGE | |
mark @name # add bookmark called @name for the current directory | |
cd @name # jump to the bookmarked location | |
cd @<tab> # list all available bookmarks | |
USAGE | |
export CDPATH=.:~/.marks/ | |
function mark { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//https://nicolamustone.blog/2015/05/14/how-to-edit-processing-orders/ | |
add_filter( 'wc_order_is_editable', 'wc_make_processing_orders_editable', 10, 2 ); | |
function wc_make_processing_orders_editable( $is_editable, $order ) { | |
if ( $order->get_status() == 'processing' ) { | |
$is_editable = true; | |
} | |
return $is_editable; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//https://stackoverflow.com/a/48896992/933782 | |
function jwt_request($token, $post) { | |
header('Content-Type: application/json'); // Specify the type of data | |
$ch = curl_init('https://APPURL.com/api/json.php'); // Initialise cURL | |
$post = json_encode($post); // Encode the data array into a JSON string | |
$authorization = "Authorization: Bearer ".$token; // Prepare the authorisation token | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json' , $authorization )); // Inject the token into the header |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#How to play a web stream on mopidy from command line (Linux) using CURL. | |
#Can also adjust moplidy playback volume if needed | |
#Clear current tracklist. Will also stop playback | |
curl -X POST -H Content-Type:application/json -d '{ | |
"method": "core.tracklist.clear", | |
"jsonrpc": "2.0", | |
"id": 1 | |
}' http://localhost:6680/mopidy/rpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert image.png -background white -alpha remove -alpha off new-image.png |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: On Sale Filter for WooCommerce Admin | |
* Description: Filter the products list in WooCommerce admin to show items on sale. | |
* Version: 1.0 | |
* Requires at least: 5.2 | |
* Requires PHP: 7.2 | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Find suspicious php files | |
find . -type f -name '*.php' | xargs egrep -i "(mail|fsockopen|pfsockopen|stream\_socket\_client|exec|system|passthru|eval|base64_decode) *(" | |
# Find suspicious images | |
find wp-content/uploads -type f -iname '*.jpg' | xargs grep -i php | |
#Find iframes | |
find . -type f -name '*.php'| grep -i '<iframe' | |
#Find files modified in last 3 days |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
* Plugin Name: WordPress Plugin Boilerplate | |
* Plugin URI: http://example.com/plugin-name-uri/ | |
* Description: This is a short description of what the plugin does. It's displayed in the WordPress admin area. | |
* Version: 1.0.0 | |
* Author: Your Name or Your Company | |
* Author URI: http://example.com/ | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Plugin Name: WordPress Log All DB Queries To File | |
* Plugin URI: http://example.com/plugin-name-uri/ | |
* Description: All database queries will be logged to uploads/sql_log.txt activated. | |
* Version: 1.0.0 | |
* Author: Ethan Piliavin | |
* Author URI: http://piliavin.com/ | |
* License: GPL-2.0+ | |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |