Skip to content

Instantly share code, notes, and snippets.

@RichiUfo
RichiUfo / install_solr_in_jetty_9.sh
Created June 23, 2021 06:45 — forked from vumaasha/install_solr_in_jetty_9.sh
Installing solr on jetty 9. Downloads jetty and solr from the given urls and installs the sample core collection1 in solr in jetty 9. Also creates a use for jetty and installs jetty as a service. *Run the script as super user or using sudo in ubuntu.*
#!/bin/sh
# set the configuration variables below, before running the script
# get the solr nightly build download link from https://builds.apache.org/job/Solr-Artifacts-4.x/lastSuccessfulBuild/artifact/solr/package/
JETTY_URL="http://eclipse.org/downloads/download.php?file=/jetty/stable-9/dist/jetty-distribution-9.0.5.v20130815.tar.gz&r=1"
JETTY_HOME="/opt/jetty"
JAVA='/usr/local/jdk1.7.0_09/bin/java'
JETTY_PORT=8085
JETTY_HOST=127.0.0.1
@RichiUfo
RichiUfo / gmaps_items.html
Created November 26, 2020 15:34 — forked from vinc/gmaps_items.html
Draw markers and circles on a map using Google Maps API and jQuery
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Items Map</title>
<script type="text/javascript"
src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js">
</script>
login url
<?php echo Mage::getUrl('customer/account/login'); ?>
logout url
<?php echo Mage::getUrl('customer/account/logout'); ?>
My Account url
<?php echo Mage::getUrl('customer/account'); ?>
Register url
@RichiUfo
RichiUfo / delete-all-woocommerce-products.php
Created August 30, 2019 20:31 — forked from mikaelz/delete-all-woocommerce-products.php
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");
@RichiUfo
RichiUfo / mysql-docker.sh
Created August 6, 2019 07:08 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@RichiUfo
RichiUfo / Handler.php
Created July 8, 2019 15:38 — forked from collegeman/Handler.php
Boilerplated files for Lumen-based WordPress plugins
<?php
namespace App\Exceptions;
use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Laravel\Lumen\Exceptions\Handler as ExceptionHandler;
@RichiUfo
RichiUfo / DefaultController.php
Created June 13, 2019 15:24 — forked from jmolivas/DefaultController.php
Drupal 8 example: How to render a Twig template and load a CSS file from a Controller
<?php
namespace Drupal\acme\Controller;
use Drupal\Core\Controller\ControllerBase;
class DefaultController extends ControllerBase
{
/**
<?php
query_posts( array(
'ignore_sticky_posts' => 1,
'meta_key' => '_ttrust_in_slideshow_value',
'meta_value' => 'true',
'posts_per_page' => 20,
'post_type' => array(
'page',
'projects'
)
@RichiUfo
RichiUfo / README.md
Created April 30, 2019 11:06 — forked from WengerK/README.md
Programatically use Solr on Drupal 8

🔍 Solr (6.1.0+) search Engine & Tika (1.13+) Extractor

We are using solr for search index.

Solr need to be configured for drupal. Follow the INSTALL.txt found in the search_api_solr module.

As a pre-requisite for running your own Solr server, you'll need Java 6 or higher.

Installation

@RichiUfo
RichiUfo / ssl.sh
Created April 19, 2019 09:01 — forked from kevinquillen/ssl.sh
Generate self signed cert for local docker dev with SAN for Chrome (example done on MacOS)
openssl req -newkey rsa:2048 -x509 -nodes -keyout cert.key -new -out cert.crt -subj /CN=*.docker.localhost -reqexts SAN -extensions SAN -config <(cat /etc/ssl/openssl.cnf <(printf '[SAN]\nsubjectAltName=DNS:*.docker.localhost')) -sha256 -days 3650