Skip to content

Instantly share code, notes, and snippets.

View jahid32's full-sized avatar

Md Mostafizur Rahman jahid32

  • Sourcetop Inc.
  • Bangladesh
View GitHub Profile
@jahid32
jahid32 / function.php
Last active June 13, 2019 11:04
WordPress Debug log
if (!function_exists('write_log')) {
function write_log ( $log ) {
if ( true === WP_DEBUG ) {
if ( is_array( $log ) || is_object( $log ) ) {
error_log( print_r( $log, true ) );
} else {
error_log( $log );
}
}
}
@jahid32
jahid32 / webpack.mix.js
Created October 26, 2018 05:08 — forked from carlosbensant/webpack.mix.js
Using Webpack/Laravel-Mix to bundle/compile Drupal 8 Theme assets.
const { mix } = require('laravel-mix')
const path = require('path')
/*
|--------------------------------------------------------------------------
| Asset Management
|--------------------------------------------------------------------------
|
| This file defines the building steps of the application. Here's where the
| client-side technologies are configured according to the needs. Steps such
@jahid32
jahid32 / helper.php
Created October 3, 2018 10:28
Drupal Logging with devel
dpm(); //
kpr()
dpq($query) // show query
@jahid32
jahid32 / ctools.php
Created July 4, 2018 10:15
Render A ctools widget to template.
$block = ctools_content_render('widget_name', 'widget_name', []);
print $block->content;
//ctools_content_render($type, $subtype, $conf, $keywords = array(), $args = array(), $context = array(), $incoming_content = '')
@jahid32
jahid32 / update_curl.sh
Created December 8, 2017 18:06 — forked from fideloper/update_curl.sh
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2
@jahid32
jahid32 / drupal.bat
Created September 19, 2017 19:03
Drupal Console
vendor\bin\drupal site:status
database:dump (dbdu) Dump structure and contents of a database
database:drop (dbd) Drop all tables in a given database.
module
module:dependency:install (modi) Install dependencies module in the application
module:download (mod) Download module or modules in application
module:install (moi) Install module or modules in the application
module:path (mop) Returns the relative path to the module (or absolute path)
module:uninstall (mou) Uninstall module or modules in the application
module:update (moup) Update core, module or modules in the application
@jahid32
jahid32 / preprocess_page.php
Created August 24, 2017 11:55
Hide Taxonomy page title
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
// Remove collection_taxonomy_term view title.
$term = taxonomy_term_load(arg(2));
if($term->vocabulary_machine_name == 'tags') {
$vars['title'] = '';
}
}
@jahid32
jahid32 / drush.txt
Last active March 3, 2017 18:23
Drush alternative Install
# Install a specific version of Drush, e.g. Drush 7.1.0
`<composer global require drush/drush:7.1.0>`
# Install master branch as a git clone. Great for contributing back to Drush project.
`<composer global require drush/drush:dev-master --prefer-source>`
Uninstall with : composer global remove drush/drush
Install latest stable Drush: composer global require drush/drush.
Verify that Drush works: drush status
@jahid32
jahid32 / xampp_php7_xdebug.md
Created January 13, 2017 14:45 — forked from odan/xampp_php7_xdebug.md
Installing Xdebug for XAMPP