Skip to content

Instantly share code, notes, and snippets.

View msankhala's full-sized avatar
🎯
Focusing

mahesh sankhala msankhala

🎯
Focusing
View GitHub Profile
@msankhala
msankhala / ducks.sh
Created February 22, 2018 16:34 — forked from thebouv/ducks.sh
ducks: linux command for the 10 largest files in current directory
du -cks * | sort -rn | head -11
# Usually set this up in my bash profile as an alias:
# alias ducks='du -cks * | sort -rn | head -11'
# Because it is fun to type ducks on the command line. :)
@msankhala
msankhala / php_evaluation_order.md
Created October 23, 2017 01:57 — forked from nikic/php_evaluation_order.md
Analysis of some weird evaluation order in PHP

Order of evaluation in PHP

Yesterday I found some people on my [favorite reddit][lolphp] wonder about the output of the following code:

<?php

$a = 1;
$c = $a + $a++;
@msankhala
msankhala / README.md
Created August 15, 2017 00:10 — forked from miku/README.md
git --track vs --set-upstream vs --set-upstream-to

README

Short excursion into git --track, --set-upstream and --set-upstream-to.

All examples use the aliases co for checkout and br for branch.

Setup:

$ git clone git@github.com:AKSW/OntoWiki.git

@msankhala
msankhala / git-restore-file.sh
Created July 4, 2017 06:37 — forked from infusion/git-restore-file.sh
Find and restore a deleted file in a Git
# Find last commit for the deleted file
git rev-list -n 1 HEAD -- $path
# Checkout the commit before the the delete happened
git checkout $commit^ -- $path
@msankhala
msankhala / MyModuleMenuLink.php
Created March 5, 2017 03:20 — forked from jerbob92/MyModuleMenuLink.php
Drupal 8 Derative Advanced Menu Link Example
@msankhala
msankhala / .vimrc
Created February 27, 2017 03:34 — forked from bendc/.vimrc
Vim config
set nocompatible
set encoding=utf-8 nobomb
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle
Plugin 'VundleVim/Vundle.vim'
@msankhala
msankhala / drupal-hooks-by-implementation
Created February 3, 2017 06:13 — forked from webchick/drupal-hooks-by-implementation
A list of hooks in all* Drupal contrib modules (6.x and 7.x), in descending order of how often they're implemented. (Consolidated a few that were renamed between 6 and 7) * Within a rounding error. :P
Array
(
[hook_menu] => 6744
[hook_uninstall] => 4742
[hook_perm(ission)] => 4012
[hook_install] => 3751
[hook_theme] => 3525
[hook_schema] => 3003
[hook_help] => 2465
[hook_form_alter] => 2273
<?php
/**
* @file
* Sets up a custom filter that enables custom shortcodes.
*/
/**
* Implementation of hook_filter_info()
*/
function custom_shortcodes_filter_info() {
<?php
/**
* Embed a view with a title. Pretty much copying the views_embed_view() but
* adding the ability to display title.
*
* @param string $name The name of the view to embed.
* @param string $display_id The display id to embed. If unsure, use 'default',
* as it will always be valid. But things like 'page'
* or 'block' should work here.
* @param string $title_tag The html header tag (h1, h2, h3, etc..).
@msankhala
msankhala / drupal-7--fapi_multifield.php
Created November 23, 2016 12:46 — forked from yann-yinn/drupal-7--fapi_multifield.php
Creat multiple field (add more buttons) for form api elements
<?php
/**
* @file
* Re-usable stuff.
*
* @FIXME multifield function seems not to work in included several times in the same page.
*/
/**
* Implements hook_theme()