Skip to content

Instantly share code, notes, and snippets.

View suryanto's full-sized avatar

Suryanto Rachmat suryanto

View GitHub Profile
<?php
use Drupal\Component\Serialization\Json;
/** @var \GuzzleHttp\Client $client */
$client = \Drupal::service('http_client_factory')->fromOptions([
'base_uri' => 'https://pweb.permata.xituz.com/',
]);
$response = $client->get('sites/default/files/feeds/dummy_mf.json');
$json_data = Json::decode($response->getBody());
#!/bin/bash
TMP="."
DB_USER="root"
DB_PASSWD="root"
DB="permata"
VERSION=`date +%F`
#First dump the structures
TABLES=`mysql --skip-column-names -e 'show tables' --user=${DB_USER} --password=${DB_PASSWD} ${DB}`
mysqldump --complete-insert --disable-keys --single-transaction --no-data --user=$DB_USER --password=$DB_PASSWD --opt $DB $TABLES > $TMP/$DB-$VERSION.sql
#!/bin/bash
TMP="/home/dev"
DB_USER="root"
DB_PASSWD="root"
DB="permata"
VERSION=`date +%F`
TABLES=`mysql --skip-column-names -e 'show tables' --user=${DB_USER} --password=${DB_PASSWD} ${DB}`
TABLES2=`echo "$TABLES" | grep -Ev "^(cache_.*|cachetags|sessions|watchdog)$"`
{
"basics": {
"name": "Suryanto Rachmat",
"label": "Web Developer",
"image": "https://avatars0.githubusercontent.com/u/416209?s=460&u=38f220a2c9c658141804f881c334c594eb1642ac&v=4",
"summary": "I’m a full stack web developer. I've worked helping some startups growing with their websites. I started developing website since 1998, and he has been developing various website since then. I have been presenting at drupalcamp events in Indonesia, Singapore, and Manila and sharing knowledge at local meetup about web development and Drupal. I have been working full time as Freelancer since 2009 helping various clients from various countries.",
"website": "https://rachmat.net",
"email": "suryanto@rachmat.net",
"location": {
"city": "Denpasar",

Keybase proof

I hereby claim:

  • I am suryanto on github.
  • I am suryanto (https://keybase.io/suryanto) on keybase.
  • I have a public key ASCj3XznyQdGpT_7sZt-2rTX64sXfvqggktMTKXlCu2-owo

To claim this, I am signing this object:

<?php
/**
* Implements hook_uninstall().
*/
function my_custom_migration_uninstall() {
$configs = [
'migrate_plus.migration_group.my_custom_migration',
'migrate_plus.migration.company',
'migrate_plus.migration.contact',
id: contact
label: migrate list of contact
migration_group: my_custom_migration
source:
plugin: contact
destination:
plugin: entity:node
<?php
namespace Drupal\my_custom_migration\Plugin\migrate\source;
use Drupal\migrate\Plugin\migrate\source\SqlBase;
use Drupal\migrate\row;
/**
* Source plugin for company.
*
-- phpMyAdmin SQL Dump
-- version 4.7.4
-- https://www.phpmyadmin.net/
--
-- Host: localhost
-- Generation Time: Sep 29, 2017 at 09:51 AM
-- Server version: 5.7.19
-- PHP Version: 7.0.23
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
CREATE TABLE `company` (
`id` mediumint(8) unsigned NOT NULL auto_increment,
`name` varchar(255),
`description` TEXT default NULL,
`phone` varchar(50) default NULL,
`email` varchar(89) default NULL,
`website` varchar(255) default "http://example.com",
PRIMARY KEY (`id`)
) AUTO_INCREMENT=1;