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
for f in *.png; do | |
convert ./"$f" -colorspace Gray ./"${f%.png}_gray.png" | |
done |
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
String.prototype.toTitleCase = function() { | |
return this.replace(/\b\w+/g, function( str ) { | |
return str.charAt(0).toUpperCase() + str.substr(1).toLowerCase(); | |
}); | |
jQuery(document).ready(function(){ | |
jQuery( SELECTOR ).text( function( i, text ) { return text.toTitleCase() } ); | |
}); |
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
'text_2_moretext'.replace( /(text_)(\d+)(_moretext)/, function( $0, $1, $2, $3 ) { | |
return $1 + String( parseInt( $2 ) + 1 ) + $3; | |
}); |
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
test test test |
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
RewriteEngine On | |
RewriteBase /sfproject/web/ | |
DirectoryIndex index.php | |
RewriteRule .* /web/index.php/$0 [PT] | |
RewriteRule ^(?:sf)\b.* /home/sfproject/lib/vendor/symfony/data/web/sf/$0 [L] |
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
//Add this at the start of preprocess_page to add a JS when you ADD or EDIT a certain content type. | |
if (arg(0) == 'node' && ((arg(1) == 'add' && arg(2) == 'contenttype') || ($vars['node']->type == 'contenttype' && arg(2) == 'edit'))) { | |
// Add your js file as usual | |
drupal_add_js('YOURJAVASCRIPT', 'theme'); | |
$vars['scripts'] = drupal_get_js(); | |
// Ensure that the addition has any effect by repopulating the scripts variable | |
} |
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
drupal_add_js('misc/jquery.urlParser-1.0.0.js', 'theme'); | |
drupal_add_js('misc/ultimatetable.js', 'theme'); | |
$vars['scripts'] = drupal_get_js(); |
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
$thisNode = $element['#node']; | |
//Finding the Key the Product1 is in | |
$product1Key = 0; | |
foreach ($header as $key=>$item) { | |
if (preg_match('/.*Product1.*/',$item)) { | |
$product1Key = $key; | |
} | |
} | |
$j=1; |
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->template->styles = array_merge($this->template->styles, ui::styles('dropdownchecklist')); | |
$this->template->scripts = array_merge($this->template->scripts, ui::scripts('dropdownchecklist')); |
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
$hatedstuff = array('Kohana','Mongo','CenterPiece'); | |
foreach ($hatedstuff as $item) { | |
echo 'I Hate '. $item; | |
} |
OlderNewer