Skip to content

Instantly share code, notes, and snippets.

View neotohin's full-sized avatar

Amzad Hossain neotohin

View GitHub Profile
@neotohin
neotohin / drush.sh
Created December 9, 2015 06:04
Drush related zsh functions for Drupal Related operation
alias dpml='drush pml | grep '
function sass.c(){
dtheme=`drush vget theme_default | cut -d' ' -f 2`;
echo "Current Theme: $dtheme";
compass compile "sites/all/themes/$dtheme";
}
function sass.w(){
dtheme=`drush vget theme_default | cut -d' ' -f 2`;
@neotohin
neotohin / tmux.conf
Created October 5, 2016 09:34
Tmux Configuration
###########################
# Configuration
###########################
# use vim key bindings
setw -g mode-keys vi
# highlight window when it has new activity
setw -g monitor-activity on
set -g visual-activity on
@neotohin
neotohin / Lsyncd Technical Session.md
Last active May 23, 2020 09:48 — forked from mralexjuarez/Lsyncd Technical Session.md
Quick Tutorial on Using Lsyncd

Lsyncd Technical Session

Lsyncd is a tool used to keep a source directory in sync with other local or remote directories. It is a solution suited keeping directories in sync by batch processing changes over to the synced directories.

This could mean:

  • Creating a live backup of a directory which would be easy to fail over to.
  • Eliminate a single point of failure by distributing the data to multiple servers
@neotohin
neotohin / write_excel.php
Created March 14, 2023 06:28
PHPExcel to generate xls from array
function erecruitment_export_write_excel( $data, $uri){
if( count($data) == 0 ) return '';
// load phpexcel library
$module_path = drupal_get_path('module', 'erecruitment');
require_once( $module_path . '/vendor/autoload.php' );
$doc = new PHPExcel();
@neotohin
neotohin / fix_collate.php
Created April 5, 2023 11:03
MySQL Collate fix
<?php
// Stolen from: http://www.holisticsystems.co.uk/blog/?p=931
// Modified to work using mysqli
$server = 'localhost';
$username = 'root';
$password = 'root';
$database = 'ojs';
$new_charset = 'utf8';
$new_collation = 'utf8_unicode_ci';