Skip to content

Instantly share code, notes, and snippets.

@otarza
otarza / composer.json
Created November 6, 2016 09:52
Fix php7 String class name issue in Mibew Messenger by patching justblackbird/handlebars.php-helpers
{
"name": "mibew/mibew",
"version": "2.1.2",
"description": "Mibew Messenger - open-source live support application",
"type": "project",
"homepage": "http://mibew.org",
"license": "Apache-2.0",
"authors": [
{
"name": "Mibew Messenger Project",
FROM andrewholgate/drupal-php70-dev:0.5.3
MAINTAINER Andrew Holgate <andrewholgate@yahoo.com>
RUN DEBIAN_FRONTEND=noninteractive apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get -y upgrade
# Project specific PHP dependencies.
# Install html-auditor module
RUN npm install -g html-auditor
RUN sed -i "389ienv[PATH] = /usr/local/bin:/usr/bin:/bin:$(npm bin -g)" /etc/php/7.0/fpm/pool.d/www.conf
@otarza
otarza / resources.md
Last active August 5, 2016 18:13
Send files to Dropbox and Google Drive from Drupal

Dropbox

Save a specified URL into a file in user's Dropbox. If the given path already exists, the file will be renamed to avoid the conflict (e.g. myfile (1).txt).

Create a new file with the contents provided in the request. Do not use this to upload a file larger than 150 MB. Instead, create an upload session with upload_session/start.

@otarza
otarza / _video_transcoder_get_json.php
Created May 17, 2016 14:33
video_transcoder_get_json
<?php
function _video_transcoder_get_json($nid){
$node = Node::load($nid);
$data = [
"id" => $node->id(),
"uuid" => $node->uuid(),
"created" => $node->getCreatedTime(),
"modified" => $node->getChangedTime(),
"date" => "",
{
".othernews": [{
"title": "ილია მეორე - გამოუვალი მდგომარეობა არ არსებობს",
"description": "„ქრისტიანული ცხოვრება სერიოზული პრობლემების დაძლევას გულისხმობს. რა თქმა უნდა, ამ გზაზე ხშირად გვხვდება ცილისწამება, ღვარძლი, გაჭირვება, შური“, - ამის შესახებ სრულიად საქართველოს კათოლიკოს-პატრიარქის,",
"image": "//photo.interpressnews.ge/img/image7/7c863224bc9e9d0d88110b8aea06e715.jpg"
}, {
"title": "მართლმადიდებელი სამყარო აღდგომის ბრწყინვალე დღესასწაულს აღნიშნავს",
"description": "მართლმადიდებელი სამყარო 1-ელ მაისს უფლის აღდგომის ბრწყინვალე დღესასწაულს აღნიშნავს. ამასთან დაკავშირებით საქართველოში მოქმედ ყველა მართლმადიდებელ ტაძარში ღამისთევის მსახურება შესრულდა.",
"image": "//photo.interpressnews.ge/img/image7/2a0bc65b815f35a9de2f25b4b8dc2463.jpg"
}, {
<?php
/**
* package SP Extra Slider
*
* @version 1.0.1
* @author MagenTech http://www.magentech.com
* @copyright (c) 2014 YouTech Company. All Rights Reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
@otarza
otarza / Drupal-8-register-form.php
Created March 2, 2016 10:42
Render drupal 8 register form
<?php
$entity = \Drupal::entityTypeManager()->getStorage('user')->create(array());
$formObject = \Drupal::entityTypeManager()
->getFormObject('user', 'register')
->setEntity($entity);
$form = \Drupal::formBuilder()->getForm($formObject);
print \Drupal::service('renderer')->render($form);
@otarza
otarza / Drupal-8-register-form.php
Created March 2, 2016 10:42
Render drupal 8 register form
<?php
$entity = \Drupal::entityTypeManager()->getStorage('user')->create(array());
$formObject = \Drupal::entityTypeManager()
->getFormObject('user', 'register')
->setEntity($entity);
$form = \Drupal::formBuilder()->getForm($formObject);
print \Drupal::service('renderer')->render($form);
@otarza
otarza / contact-regression-reroll-fix-contact-navigation-block-interdiff
Created January 29, 2016 07:11
Reroll for Regression: category selector missing on site wide contact form: https://www.drupal.org/node/1997692#comment-10146010
diff --git a/core/modules/contact/src/Plugin/Block/ContactNavigationBlock.php b/core/modules/contact/src/Plugin/Block/ContactNavigationBlock.php
index 6b79758..d4ad47d 100644
--- a/core/modules/contact/src/Plugin/Block/ContactNavigationBlock.php
+++ b/core/modules/contact/src/Plugin/Block/ContactNavigationBlock.php
@@ -7,14 +7,14 @@
namespace Drupal\contact\Plugin\Block;
-use Drupal\Component\Utility\String;
+use Drupal\Component\Utility\Html;
@otarza
otarza / conflict
Created January 28, 2016 21:25
conflict
<<<<<<< c45d88ada97a23a4aadd4aec9ad201c2a29370f1
{#
/**
=======
{#/**
>>>>>>> commit with theme (merged with feature/theme)
* @file
* Theme override to display a menu.
*
* Available variables: