This file contains hidden or 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
All the Singletons, all the Singletons | |
All the Singletons, all the Singletons | |
All the Singletons, all the Singletons | |
All the Singletons, all the Singletons | |
If you liked it then you shoulda put an instance on it | |
If you liked it then you shoulda made it global static | |
Don't be mad once you see you can't unit test it | |
If you liked it then you shoulda made a Singleton |
This file contains hidden or 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
# The initial version | |
if [ ! -f .env ] | |
then | |
export $(cat .env | xargs) | |
fi | |
# My favorite from the comments. Thanks @richarddewit & others! | |
set -a && source .env && set +a |
This file contains hidden or 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
add_filter( 'graphql_post_object_connection_query_args', function( $args ) { | |
$args['no_found_rows'] = false; | |
return $args; | |
} ); | |
add_filter( 'graphql_connection_page_info', function( $page_info, $connection ) { | |
$page_info['total'] = null; | |
if ( $connection->get_query() instanceof \WP_Query ) { | |
if ( isset( $connection->get_query()->found_posts ) ) { | |
$page_info['total'] = (int) $connection->get_query()->found_posts; |