View list-big-files.sh
sudo find / -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
View hide-instantsearch.php
<?php
add_filter( 'algolia_should_override_search_with_instantsearch', function() {
return false;
} );
View replace-domain-wordpress-algolia-plugin.php
<?php
/**
* @version 0.1.0
* Plugin Name: Replace domain in Algolia Search plugin for WordPress
*/
function custom_post_shared_attributes( array $shared_attributes ) {
$shared_attributes['permalink'] = str_replace( 'admin.rushlimbaugh.com', 'www.rushlimbaugh.com', $shared_attributes['permalink'] );
return $shared_attributes;
}
View algolia-woocommerce-instantsearch.php
<?php
// Inject instantsearch.js on every page regardless of backend config.
add_filter( 'algolia_wc_should_display_instantsearch', '__return_true' );
// This will make sure the search is displayed on load. Oterwise it waits for the query to change to be displayed.
add_filter( 'algolia_config', function( array $config ) {
$config['woocommerce']['replace_page'] = true;
View algolia-woocommerce-filter-facets.php
<?php
add_filter( 'algolia_wc_attributes_for_faceting', function( $attributes ) {
$only_ids = array(
15, // Main Style
13, // Main Color
49, // Sizes
23, // Brand
4, // Collection
22, // Material
View algolia-custom-post-types.php
<?php
// See: https://github.com/algolia/algoliasearch-wordpress/blob/master/includes/class-algolia-plugin.php#L181
// To be added to the functions.php of your active theme for example.
add_filter( 'algolia_searchable_post_types', function( array $post_types ) {
$post_types[] = 'my_custom_post_type';
return $post_types;
} );
View display-instantsearch-all-pages.php
<?php
add_filter( 'algolia_wc_should_display_instantsearch', function( $should_display ) {
// If configuration already considers it should be shawn, show it.
if ( $should_display ) {
return true;
}
// Detect the current page and only return true when you want instantsearch.js to be injected.
if ( is_shop() ) {
View custom-avatar.php
<?php
/**
* Plugin Name: Customize data pushed to Algolia.
*/
/**
* @param int $user_id
* @param string $fallback_avatar_url
*
* @return string
View customize-algolia-autocomplete-labels.php
<?php
add_filter( 'algolia_autocomplete_config', function ( $config ) {
// echo '<pre>';
// var_dump( $config );
// echo '</pre>';
foreach ( $config as &$index ) {
// Adjust and adapt according to your needs.
if ( $index['index_id'] === 'posts_post' ) {
View autocomplete.php
<!-- ... -->
<script type="text/html" id="tmpl-autocomplete-zendesk-suggestion">
<a class="suggestion-link" href="https://algolia-test.zendesk.com/hc/{{ data.locale.locale }}/articles/{{ data.id }}">
<div class="suggestion-post-attributes">
<span class="suggestion-post-title">{{{ data._highlightResult.title.value }}}</span>
<# if ( data._snippetResult['body_safe'] ) { #>
<span class="suggestion-post-content">{{{ data._snippetResult['body_safe'].value }}}</span>
<# } #>
</div>
</a>