Skip to content

Instantly share code, notes, and snippets.

@manojiksula
manojiksula / MyService.php
Created May 1, 2020 21:02 — forked from JeffTomlinson/MyService.php
Drupal 8 Configuration Dependency Injection
<?php
namespace Drupal\my_module\Services;
use Drupal\Core\Config\ConfigFactory;
/**
* Class MyService.
*
* @package Drupal\my_module\Services
@manojiksula
manojiksula / MyCustomBlock.php
Created April 23, 2020 12:03 — forked from crittermike/MyCustomBlock.php
Drupal 8 block with custom cache context and tags
<?php
class MyCustomBlock extends BlockBase {
public function build() {
return array(
'#markup' => $this->t('My custom block content'),
'#cache' => array(
'contexts' => ['url.path'], // https://www.drupal.org/developing/api/8/cache/contexts
'tags' => ['node:1', 'node:2'] // https://www.drupal.org/developing/api/8/cache/tags
),
@manojiksula
manojiksula / gist:90ac770ba4bf16be8db492963af10885
Created April 16, 2020 07:14
Sublime Text 3 license key 2020 Updated and working perfectly
Thanks GUys use this oone
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
@manojiksula
manojiksula / container-layout-names.md
Created April 14, 2020 10:53 — forked from joshfortyfour/container-layout-names.md
List of container layout names in Magento 2 Community Edition
  • actions_apply_to
  • admin.scope.col.wrap
  • adminhtml.block.report.product.lowstock.grid.container
  • adminhtml.catalog.product.set.edit.wrapper
  • after.body.start
  • alert.urls
  • assign_products_container
  • available_sort_by_group
  • backend.page
  • backend.session.activity
@manojiksula
manojiksula / Magento2-API-OAuth-based_authentication.php
Created April 12, 2020 18:55 — forked from rafaelstz/Magento2-API-OAuth-based_authentication.php
Sample files to use Magento 2 REST and SOAP API. Using Token-based authentication and OAuth-based authentication method.
<?php
function sign($method, $url, $data, $consumerSecret, $tokenSecret)
{
$url = urlEncodeAsZend($url);
$data = urlEncodeAsZend(http_build_query($data, '', '&'));
$data = implode('&', [$method, $url, $data]);
$secret = implode('&', [$consumerSecret, $tokenSecret]);
@manojiksula
manojiksula / gist:01e39538797e6b03c69049a069f99ede
Created February 5, 2020 16:46 — forked from prime31/gist:5675017
Simple PHP script showing how to send an Android push notification. Be sure to replace the API_ACCESS_KEY with a proper one from the Google API's Console page. To use the script, just call scriptName.php?id=THE_DEVICE_REGISTRATION_ID
<?php
// API access key from Google API's Console
define( 'API_ACCESS_KEY', 'YOUR-API-ACCESS-KEY-GOES-HERE' );
$registrationIds = array( $_GET['id'] );
// prep the bundle
$msg = array
@manojiksula
manojiksula / FancyService.php
Created January 2, 2020 14:16 — forked from Jaesin/FancyService.php
Autowiring services in Drupal 8
<?php
/**
* @file `src/FancyService.php`
*
* Fancy service provides lyric segments from Iggy Azalea's song, "Fancy".
*/
namespace Drupal\example;
use Drupal\Core\Language\LanguageManagerInterface;
@manojiksula
manojiksula / PushNotifications.php
Created September 20, 2019 16:31 — forked from joashp/PushNotifications.php
Simple PHP script to send Android Push Notification, iOS Push Notification and Windows Phone 8 Push Notification
<?php
// Server file
class PushNotifications {
// (Android)API access key from Google API's Console.
private static $API_ACCESS_KEY = 'AIzaSyDG3fYAj1uW7VB-wejaMJyJXiO5JagAsYI';
// (iOS) Private key's passphrase.
private static $passphrase = 'joashp';
// (Windows Phone 8) The name of our push channel.
private static $channelName = "joashp";
@manojiksula
manojiksula / Dockerfile
Created July 13, 2019 07:51 — forked from bmvakili/Dockerfile
liferay frontend development via docker container
FROM ubuntu
RUN apt-get update && \
apt-get -y install curl software-properties-common && \
curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
apt-get update && \
apt-get -y install nodejs && \
useradd -m -s $(which bash) liferay && \
chown -R liferay:liferay /usr/lib/node_modules
@manojiksula
manojiksula / Jenkinsfile
Created July 13, 2019 07:50 — forked from bmvakili/Jenkinsfile
Liferay example Jenkinsfile
pipeline {
agent any
options {
buildDiscarder(logRotator(numToKeepStr: '21', artifactNumToKeepStr: '50'))
timestamps()
timeout(time: 5, unit: 'MINUTES')
}
parameters{
string(name: 'JAVA_HOME', defaultValue: '/var/jenkins_home/tools/hudson.model.JDK/JDK_7u80/', description: 'JDK', )
}