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: