Skip to content

Instantly share code, notes, and snippets.

View saniyat's full-sized avatar

Saniyat saniyat

  • Sourcetop Inc.
  • Dhaka, Bangladesh
View GitHub Profile
@saniyat
saniyat / gist:8bb74680a6348b0e38689443c1867d4c
Created October 10, 2018 20:58
GIT: Branch delete and cleanups
// Delete all merged branches both from local and remote.
git branch -r --merged | grep origin | egrep -v '>|master' | cut -d/ -f2- | xargs git push origin --delete
// Clean deleted branches.
git fetch -p && for branch in `git branch -vv | grep ': gone]' | gawk '{print $1}'`; do git branch -D $branch; done
@saniyat
saniyat / solr.php
Last active May 25, 2017 15:07
Solr query
<?php
function check_solr_query() {
$solr = apachesolr_get_solr();
$query = apachesolr_drupal_query('apachesolr', array('q' => 'dog'));
$resp = $query->search();
$data = array();
foreach($resp->response->docs as $d) {
$data[$d->entity_id] = $d->label;
# IMPORTANT
# {$path} is used to specify AMPPS installation path
# MySQL config file for medium systems.
#
# This is for a system with little memory (32M - 64M) where MySQL plays
# an important part, or systems up to 128M where MySQL is used together with
# other programs (such as a web server)
#
# You can copy this file to
@saniyat
saniyat / Sublime Settings
Last active April 16, 2018 19:39
Sublime Settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Theme - Hero/Hero Dark.tmTheme",
"default_line_ending": "unix",
"detect_indentation": true,
"ensure_newline_at_eof_on_save": true,
"fade_fold_buttons": false,
"fallback_encoding": "UTF-8",
"file_exclude_patterns":
[
@saniyat
saniyat / my.cnf
Last active September 21, 2015 14:34 — forked from anonymous/gist:db39f1b197d034ea8fea
my.cnf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@saniyat
saniyat / virtualhost
Last active March 4, 2017 19:38
Virtual Host
# Make a file named virtualhost and place it in /usr/local/bin folder.
# Give +x permission to the file.
# use as
# virtualhost sitename.tld relative_path_to/var/www/
# i.e virtualhost d7.san d7
#!/bin/bash
### Set default parameters
action='create'
domain=$1