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 / dabblet.css
Created May 22, 2012 03:49
animate gradients
/**
* animate gradients
*/
body {
padding-top: 75px;
}
.btn {
margin: 5px;
padding: 13px 35px;
border: solid 2px lightblue;
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
/*
For some reason, the change() event only fires when the input field loses focus.
Binding to other options ('change keypress paste focus textInput input') will
fire the event several times, which is bad. The below code works even when
content is pasted into the text field, and only fires once as expected.
*/
$('#search-form .term').bind('input', function(){
console.log('this actually works');
});
dependencies[] = ctools
; Views Handlers
files[] = includes/views/mymodule_handler_handlername.inc
@msankhala
msankhala / dabblet.css
Created October 29, 2013 06:30 — forked from LeaVerou/dabblet.css
Easy trapezoids with 3D transforms
/**
* Easy trapezoids with 3D transforms
*/
p {
position: relative;
display: inline-block;
padding: 1em;
margin: 2em;
}
@msankhala
msankhala / 0_reuse_code.js
Created June 2, 2014 07:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
<?php
/**
* Theme_menu_tree doesn't provide any context information
* THIS SUCKS
* But you can use hook_block_view_alter to change the theme wrapper
* OUF!
*/
function MYTHEME_menu_tree(&$variables) {
<?php
function themename_menu_link(&$variables) {
$element = $variables['element'];
$sub_menu = '';
$element['#attributes']['data-menu-parent'] = $element['#original_link']['menu_name'] . '-' . $element['#original_link']['depth'];
if ($element['#below']) {
$sub_menu = drupal_render($element['#below']);
}
@msankhala
msankhala / gist:a5a592eacf92b5344299
Created October 22, 2015 06:55 — forked from Steven-Rose/gist:3943830
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.
@msankhala
msankhala / ansi-color.php
Created December 1, 2015 07:15 — forked from superbrothers/ansi-color.php
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";