Skip to content

Instantly share code, notes, and snippets.

View ramlev's full-sized avatar

Hasse Ramlev Wilson ramlev

View GitHub Profile
@ramlev
ramlev / moduleinfo.drush.inc
Created November 10, 2011 11:51
Show some information of defined drupal module or theme, such as name, description, version and dependencies
<?php
/**
* Need drupal.org/project/drush.
*
* Very beta. Will show up as a github repo very soon.
*
* Download the raw file, and put it in ~/.drush/
*
* Examples
# cat sites/all/modules/contrib/views/*info
# cd DRUPAL_INSTALLATION
# drush moduleinfo views
Name Views
Description Create customized lists and queries from your database.
Version 7.x-3.0-rc1
Module path profiles/artesis/modules/contrib/views
Dependencies ctools
@ramlev
ramlev / .vimrc
Created January 15, 2012 19:52
Vim configuration file.
set nocompatible
filetype off " force reloading after pathogen is loaded
" Use pathogen to easily modify the runtime path to include all
" plugins under the ~/.vim/bundle directory
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on " enable detection, plugins and indenting in one step
set mouse=a " use mouse gestures
@ramlev
ramlev / gist:1652460
Created January 21, 2012 11:37
phpcs example
FILE: /Users/me/www/drupal-7.10/modules/poll/poll.module
--------------------------------------------------------------------------------
FOUND 630 ERROR(S) AND 36 WARNING(S) AFFECTING 519 LINE(S)
--------------------------------------------------------------------------------
4 | ERROR | There must be exactly one blank line before the tags in file
| | comment
7 | WARNING | PHP version not specified
7 | ERROR | Missing @category tag in file comment
7 | ERROR | Missing @package tag in file comment
7 | ERROR | Missing @author tag in file comment
@ramlev
ramlev / gist:1652469
Created January 21, 2012 11:40
PHPCS with Drupal output
FILE: /Users/me/www/drupal-7.10/modules/poll/poll.module
--------------------------------------------------------------------------------
FOUND 9 ERROR(S) AND 4 WARNING(S) AFFECTING 13 LINE(S)
--------------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 81 characters
195 | WARNING | A comma should follow the last multiline array item. Found: )
227 | WARNING | A comma should follow the last multiline array item. Found: )
315 | ERROR | Inline comments must end in full-stops, exclamation marks, or
| | question marks
380 | ERROR | You must use "/**" style comments for a function comment
@ramlev
ramlev / settings.php
Created July 6, 2012 09:57
Varnish settings
// Add Varnish as the page cache handler.
$conf['cache_backends'] = array('profiles/zcf_site/modules/contrib/varnish/varnish.cache.inc');
$conf['cache_class_cache_page'] = 'VarnishCache';
// Drupal 7 does not cache pages when we invoke hooks during bootstrap. This needs
// to be disabled.
$conf['page_cache_invoke_hooks'] = FALSE;
@ramlev
ramlev / gist:3186936
Created July 27, 2012 09:03
brew upgrade mariadb
> brew upgrade
==> Upgrading mariadb
==> Downloading http://ftp.osuosl.org/pub/mariadb/mariadb-5.3.7/kvm-tarbake-jaunty-x86/mariadb-5.3.7.tar.gz
Already downloaded: /Library/Caches/Homebrew/mariadb-5.3.7.tar.gz
==> ./configure --without-docs --without-debug --prefix=/usr/local/Cellar/mariadb/5.3.7 --localstatedir=/usr/local/var/mysql --sys
==> make install
Making install in .
make abi_headers="include/mysql.h include/mysql/client_plugin.h include/mysql/plugin_auth.h" do_abi_check
set -ex; \
for file in include/mysql.h include/mysql/client_plugin.h include/mysql/plugin_auth.h; do \
; Basic Drush Make file
; Core version
; ------------
; Each makefile should begin by declaring the core version of Drupal that all
; projects should be compatible with.
core = 7.15
api = 2
projects[] = drupal