A list of amazingly awesome PHP libraries, resources and shiny things.
- Composer
- Composer Related
- Frameworks
- Micro Frameworks
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left) | |
// https://gist.github.com/JamieMason/7580315 | |
// | |
// 1. Go to https://twitter.com/YOUR_USER_NAME/following | |
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac) | |
// 3. Paste this into the Developer Console and run it | |
// | |
// Last Updated: 09 April 2020 | |
(() => { | |
const $followButtons = '[data-testid$="-unfollow"]'; |
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left) | |
// https://gist.github.com/JamieMason/7580315 | |
// | |
// 1. Go to https://twitter.com/YOUR_USER_NAME/following | |
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac) | |
// 3. Paste this into the Developer Console and run it | |
// | |
// Last Updated: 09 April 2020 | |
(() => { | |
const $followButtons = '[data-testid$="-unfollow"]'; |
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left) | |
// https://gist.github.com/JamieMason/7580315 | |
// | |
// 1. Go to https://twitter.com/YOUR_USER_NAME/following | |
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac) | |
// 3. Paste this into the Developer Console and run it | |
// | |
// Last Updated: 09 April 2020 | |
(() => { | |
const $followButtons = '[data-testid$="-unfollow"]'; |
<?php | |
/** | |
* Unhook default EDD discount field | |
*/ | |
remove_action( 'edd_checkout_form_top', 'edd_discount_field', -1 ); | |
/** | |
* Add our own callback for the discount field, keeping the same CSS as before | |
*/ |
# GET number of orders | |
select count(*)from wp_posts where post_type = 'shop_order'; | |
# DELETE ORDERS | |
delete from wp_postmeta where post_id in ( | |
select ID from wp_posts where post_type = 'shop_order'); | |
delete from wp_posts where post_type = 'shop_order'; | |
# DELETE order refunds |
# GET number of orders | |
select count(*)from wp_posts where post_type = 'shop_order'; | |
# DELETE ORDERS | |
delete from wp_postmeta where post_id in ( | |
select ID from wp_posts where post_type = 'shop_order'); | |
delete from wp_posts where post_type = 'shop_order'; | |
# DELETE order refunds |
// call it in your theme or plugin function file. | |
wp_frm_populate_user_dropdown( 485, 'subscriber' ); // you can change field_id & role as per your need. | |
function wp_frm_populate_user_dropdown($field_id, $role = 'subscriber') { | |
$user_info = array ( 'field_id' => $field_id, 'role' => $role ); | |
add_filter('frm_setup_new_fields_vars', function ( $values, $field ) use ($user_info) { | |
$values = frm_populate_user_dropdown($values, $field, $user_info); | |
return $values; |
[program:laravel-worker] | |
process_name=%(program_name)s_%(process_num)02d | |
command=php /home/forge/app.com/artisan queue:work sqs --sleep=3 --tries=3 | |
autostart=true | |
autorestart=true | |
user=forge | |
numprocs=8 | |
redirect_stderr=true | |
stdout_logfile=/home/forge/app.com/worker.log |
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
use PhpAmqpLib\Connection\AMQPStreamConnection; | |
$connection = new AMQPStreamConnection('localhost', 5672, 'guest', 'guest'); | |
$channel = $connection->channel(); | |
$channel->queue_declare('hello', false, false, false, false); |