Skip to content

Instantly share code, notes, and snippets.

View sadanandkenganal's full-sized avatar

Sadanand Kenganal sadanandkenganal

View GitHub Profile
@sadanandkenganal
sadanandkenganal / activelink_codeigniter.md
Last active April 3, 2022 12:24
Add active class to menu in codeigniter.
@sadanandkenganal
sadanandkenganal / clea_url_drupal7.md
Last active September 7, 2017 07:23
Enable Clean URL's drupal 7

It's very simple.

In your project Directory, you have .htaccess file. open it and make the following changes. Its a hidden file.

  1. Modify the RewriteBase if you are using Drupal in a subdirectory or in a VirtualDocumentRoot and the rewrite rules are not working properly. For example if your site is at http://example.com/drupal uncomment and modify the following line:

Line 106 - RewriteBase /yourprojectname(project folder)

  1. If your site is running in a VirtualDocumentRoot at http://example.com/, uncomment the following line and modify:
@sadanandkenganal
sadanandkenganal / mcrypt_ext_missing.md
Created October 8, 2015 04:37
The requested PHP extension ext-mcrypt * is missing from your system
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
@sadanandkenganal
sadanandkenganal / drupal_coding_standards_check.md
Last active May 18, 2016 09:42
Detects violations of a defined set of coding standards. It works with Drupal 6, 7, or 8.

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:

@sadanandkenganal
sadanandkenganal / install_drush_on_mac.md
Last active May 9, 2016 04:25
Installing Drush on Mac
@sadanandkenganal
sadanandkenganal / terminal_appearance_mac_os_x.md
Created February 9, 2016 06:05
How to Improve the Terminal Appearance in Mac OS X

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 / git_push_server_port.md
Created October 6, 2015 18:06
Git push with server port

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 August 29, 2015 14:19
Install Ruby on Rails (ROR) on Ubuntu 14.04

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 / replace_flag_links.md
Created June 24, 2014 08:32
Replace flag links by image icons in drupal 7
@sadanandkenganal
sadanandkenganal / drupal_add_js.md
Created June 20, 2014 06:49
Add Javascript OR CSS to Particular Content Type Page.

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');
    }   
}