This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_menu_alter() | |
* | |
* Swaps out default taxonomy page callback to use a custom callback. | |
* | |
* @param $items | |
* | |
* @see og_vocab_grid_taxonomy_term_page(). | |
*/ | |
function og_vocab_grid_menu_alter(&$items) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a list of common Drupal paths you may want to exclude. | |
// I often use these when I'm placing a block "globally" | |
admin | |
admin/* | |
batch | |
node/add* | |
node/*/* | |
user/*/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docCookies: { | |
getItem: function (sKey) { | |
return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; | |
}, | |
setItem: function (sKey, sValue, vEnd, sPath, sDomain, bSecure) { | |
if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { | |
return false; | |
} | |
var sExpires = ""; | |
if (vEnd) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin header($size) { | |
font-size: $size; | |
line-height: $size; | |
@include breakpoint($small) { font-size: 1.125 * $size; } | |
} | |
$header-sizes: $h1-font-size, | |
$h2-font-size, | |
$h3-font-size, | |
$h4-font-size, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type Clock struct { | |
h, m int | |
} | |
func (c *Clock) set(h, m int) { | |
var dh int | |
dh, c.m = c.decompose(m, 60) | |
_, c.h = c.decompose(h+dh, 24) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
foo(){ | |
return function(){ | |
// work. | |
} | |
} | |
bar((function) f){ | |
return function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_array_insert(&$array, $insert, $key_before) { | |
$offset = 1; | |
while (key($array) != $key_before) { | |
next($array); | |
$offset++; | |
} | |
$array_before = array_slice($array, 0, $offset, TRUE); | |
$array_after = array_slice($array, $offset, NULL, TRUE); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sunrst () { | |
if [[ $# < 2 ]]; then | |
echo "You must specify at least an alias and a multisite directory name." | |
fi | |
read -p "Would you like to run updates (y/n)? " UPDB | |
alias=$1 | |
site=$2 | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sitereset () { | |
if [[ $# < 2 ]]; then | |
echo "You must specify at least an alias and a multisite directory name." | |
return | |
fi | |
read -p "Would you like to run updates (y/n)? " updb | |
alias=$1 | |
site=$2 |
OlderNewer