Skip to content

Instantly share code, notes, and snippets.

View dbjpanda's full-sized avatar

Dibyajyoti Panda dbjpanda

View GitHub Profile
<?php
namespace Drupal\Tests\search_api_location\Kernel;
use Drupal\KernelTests\KernelTestBase;
use Drupal\search_api_location\Plugin\search_api_location\location_input\Geocode;
/**
* Test for the geocode plugin.
*
<?php
namespace Drupal\search_api_location\Plugin\search_api_location\location_input;
use Drupal\Core\Form\FormStateInterface;
use Drupal\search_api_location\LocationInput\LocationInputPluginBase;
/**
* Represents the Raw Location Input.
*
<?php
namespace Drupal\facets_map_widget\Plugin\facets\query_type;
use Drupal\facets\QueryType\QueryTypePluginBase;
use Drupal\facets\Result\Result;
/**
* Provides support for location facets within the Search API scope.
*
<?php
/**
* Implements hook_facets_search_api_query_type_mapping_alter().
*/
function facets_map_widget_facets_search_api_query_type_mapping_alter($backend_plugin_id, array &$query_types) {
if ($backend_plugin_id == 'search_api_solr') {
$query_types['location'] = 'search_api_location';
}
}
// Rpt data type query test.
$facets_options['location_rpt'] = [
'field' => 'location_rpt',
'geom' => '["-180 -90" TO "180 90"]',
'gridLevel' => '2',
'maxCells' => '35554432',
'distErrPct' => '',
'distErr' => '',
'format' => 'ints2D',
];
{#
/**
* @file
* Default theme implementation to display a single page.
*
* The doctype, html, head and body tags are not in this template. Instead they
* can be found in the html.html.twig template in this directory.
*
* Available variables:
*
@dbjpanda
dbjpanda / install.sh
Created March 12, 2018 04:46
Script to install Drupal 8 on top of Digitalocean LEMP server.
chmod +x d8.sh
yes "yes" | ./d8.sh
#!/bin/bash
sudo apt-get purge php.*
sudo rm -rf /etc/php
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt-get update
<form action="/user/password" method="post" id="user-pass" accept-charset="UTF-8"><div><div class="form-item form-type-textfield form-item-name">
<label for="edit-name--2"> Enter your username or email address associated with your user account <span class="form-required" title="This field is required.">*</span></label>
<input type="text" id="edit-name--2" name="name" value="" size="60" maxlength="254" class="form-text required" />
</div>
<input type="hidden" name="form_build_id" value="form-r8sEnKTdbfHfwvUA5rVnE1wo8VDWk0DptEMxu97zXNU" />
<input type="hidden" name="form_id" value="user_pass" />
<div class="edit-token-a123-wrapper"><div class="form-item form-type-textfield form-item-token-a123">
<label for="edit-token-a123--2">token a123 </label>
<input type="text" id="edit-token-a123--2" name="token_a123" value="" size="20" maxlength="128" class="form-text" />
<div class="description">To prevent automated spam submissions leave this field empty.</div>
FROM nginx:stable-alpine
RUN mkdir -p /var/www/site_name/public_html \
&& addgroup -g 82 -S www-data \
&& adduser -u 82 -D -S -G www-data www-data \
&& chown -R www-data:www-data /var/www/site_name/public_html
# && chmod -R 775 /var/www
COPY nginx.conf /etc/nginx/nginx.conf
COPY default.conf /etc/nginx/conf.d/default.conf
# from https://www.drupal.org/docs/8/system-requirements/drupal-8-php-requirements
FROM php:7.2-fpm-alpine
# install the PHP extensions we need
# postgresql-dev is needed for https://bugs.alpinelinux.org/issues/3642
RUN set -ex \
&& apk add --no-cache --virtual .build-deps \
coreutils \
freetype-dev \
libjpeg-turbo-dev \