Skip to content

Instantly share code, notes, and snippets.

Sadanand Kenganal sadanandkenganal

Block or report user

Report or block sadanandkenganal

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sadanandkenganal
sadanandkenganal / drupal_coding_standards_check.md
Last active May 18, 2016
Detects violations of a defined set of coding standards. It works with Drupal 6, 7, or 8.
View drupal_coding_standards_check.md

Detects violations of a defined set of coding standards. It works with Drupal 6, 7, or 8.

PHP_CodeSniffer is a library that tokenises PHP, JavaScript and CSS files and detects violations of a defined set of coding standards. It works with Drupal 6, 7, or 8.

Coder contains "sniffs" for PHP CodeSniffer. These "sniffs" tell PHP CodeSniffer whether code meets Drupal coding standards or not.

Steps

1.First, make sure Composer is installed correctly:

View install_drush_on_mac.md
@sadanandkenganal
sadanandkenganal / terminal_appearance_mac_os_x.md
Created Feb 9, 2016
How to Improve the Terminal Appearance in Mac OS X
View terminal_appearance_mac_os_x.md

Steps to setup

  1. Open Terminal and type nano .bash_profile
  2. Paste the following :
export PS1="\[\033[36m\]\u\[\033[m\]@\[\033[32m\]\h:\[\033[33;1m\]\w\[\033[m\]\$ "
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'
@sadanandkenganal
sadanandkenganal / mcrypt_ext_missing.md
Created Oct 8, 2015
The requested PHP extension ext-mcrypt * is missing from your system
View mcrypt_ext_missing.md
sudo apt-get install php5-mcrypt
sudo ln -s /etc/php5/conf.d/mcrypt.ini /etc/php5/mods-available
sudo php5enmod mcrypt 
sudo service apache2 restart
View git_push_server_port.md

1. Git clone

git clone  ssh://user@ipaddr:port_nu/path_to_git_on_server

OR

Do it on server machine

1. login through ssh, 
    ssh user@ip -pport_nu -v
@sadanandkenganal
sadanandkenganal / install_ruby_on_rails.md
Last active Aug 29, 2015
Install Ruby on Rails (ROR) on Ubuntu 14.04
View install_ruby_on_rails.md

1. Install some dependencies for Ruby.

sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev

2. using rbenv(recommended : Ruby Environment). Since there are other methods also.

@sadanandkenganal
sadanandkenganal / activelink_codeigniter.md
Last active Sep 6, 2019
Add active class to menu in codeigniter.
View activelink_codeigniter.md
@sadanandkenganal
sadanandkenganal / replace_flag_links.md
Created Jun 24, 2014
Replace flag links by image icons in drupal 7
View replace_flag_links.md
@sadanandkenganal
sadanandkenganal / drupal_add_js.md
Created Jun 20, 2014
Add Javascript OR CSS to Particular Content Type Page.
View drupal_add_js.md

You should add this code in template.php file inside your custom or contributed theme.

function tb_rave_preprocess_node(&$variables) {
    if($node->type == 'contenttypename') {
      $node = $variables['node'];
      drupal_add_library('system', 'ui.tabs');
      drupal_add_css(drupal_get_path('theme', 'yourtheme') . '/example.css');
      drupal_add_css(drupal_get_path('theme', 'yourtheme') . '/example.js');
    }   
}
@sadanandkenganal
sadanandkenganal / drupal_menu_tabs.md
Last active Aug 29, 2015
How to hide menu tabs, menu links and assign access permissions in Drupal 7
View drupal_menu_tabs.md

Hide menu tabs, menu links and assign access permissions in Drupal 7

hide "create new account" tab in "/user" page. To hide menu tabs we have to use hook_menu_alter hook. This hook changes the menu items. So here we are going to alter menu tabs that come with user module. Using this hook we can also do some other changes like title, permissions etc.

###For hiding menu tabs

Eg: Hide 'create new account' tab  and 'request password' tab.

In your Custom module
You can’t perform that action at this time.