Skip to content

Instantly share code, notes, and snippets.

View msankhala's full-sized avatar
🎯
Focusing

mahesh sankhala msankhala

🎯
Focusing
View GitHub Profile
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@pascalduez
pascalduez / demo.module
Created December 24, 2011 15:02
Drupal 7 — Basic Ajax form submit (Ajax framework)
<?php
/**
* @file
* Demo module, Basic Ajax form submit (Ajax framework).
*/
/**
* Implements hook_menu().
*/
@gregorynicholas
gregorynicholas / .inputrc
Last active April 19, 2024 04:10
OSX .inputrc to make terminal way better. and by better i mean i'm naked
"\e[1~": beginning-of-line
"\e[4~": end-of-line
"\e[5~": history-search-backward
"\e[6~": history-search-forward
"\e[3~": delete-char
"\e[2~": quoted-insert
"\e[5C": forward-word
"\e[5D": backward-word
"\e\e[C": forward-word
"\e\e[D": backward-word
@cecilemuller
cecilemuller / gist:1973201
Created March 4, 2012 14:23
Programmatically change the active theme in Drupal 7
<?php
/**
* Defines a theme callback function per registered path.
*/
function MODULENAME_menu_alter(&$items) {
$items['node/%node']['theme callback'] = 'MODULENAME_default_node_theme';
$items['node/%node/edit']['theme callback'] = 'MODULENAME_edit_node_theme';
$items['node/%node/edit']['theme arguments'] = array(1);
}
@yann-yinn
yann-yinn / drupal-7--fapi_multifield.php
Last active June 14, 2018 15:12
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()
@JeffreyWay
JeffreyWay / gist:2889230
Created June 7, 2012 14:56
Simple PHP Quiz
// Fun little quiz
Assuming this string: "January 5th, 2012"
In the shortest amount of code possible, place:
- 'January' within a $month variable
- '5th' within a $day variable
- '2012' within a $year variable.
@superbrothers
superbrothers / ansi-color.php
Created August 23, 2012 01:49
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";
@chrisjlee
chrisjlee / drush-turn-off-aggregate-assets.txt
Created September 24, 2012 17:20
drush disable js/css aggregation
// To turn on JS Aggregation
drush vset preprocess_js 1 --yes
// To clear all Cache
drush cc all
// To disable JS Aggregation
drush vset preprocess_js 0 --yes
// To clear cache of JS and CSS only
@Steven-Rose
Steven-Rose / gist:3943830
Created October 24, 2012 04:27
VI: Select all + delete, select all + copy
Select all and delete (actually move to buffer)
:%d
Select all and copy to buffer
:%y
Use p to paste the buffer.
@Zmetser
Zmetser / checkbox_align.html
Created November 26, 2012 12:07
How to align checkboxes and their labels consistently cross browsers
<form>
<div>
<label><input type="checkbox" /> Label text</label>
</div>
<div>
<label><input type="checkbox" /> http://stackoverflow.com/questions/306252/how-to-align-checkboxes-and-their-labels-consistently-cross-browsers</label>
</div>
</form>
<style type="text/css">