This file contains hidden or 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
(function ($) { | |
Drupal.behaviors.accordion = { | |
attach: function (context, settings) { | |
$('.accordion h3.title').once('accordion', function () { | |
$('.accordion h3.title').toggle(function () { | |
// Actions here | |
}, function () { | |
// Actions here | |
}); | |
}); |
This file contains hidden or 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
/* | |
* See: http://www.oliverdavies.co.uk/blog/include-css-fonts-using-sass-each-loop | |
* Usage: font-family: "FuturaBook"; | |
*/ | |
@each $family in FuturaBook, FuturaBold, FuturaBoldItalic, FuturaItalic { | |
@font-face { | |
font-family: #{$family}; | |
src: url('../fonts/#{$family}/#{$family}.eot'); | |
src: url('../fonts/#{$family}/#{$family}.eot?#iefix') format('embedded-opentype'), | |
url('../fonts/#{$family}/#{$family}.woff') format('woff'), |
This file contains hidden or 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
drush up --security-only |
This file contains hidden or 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
drush make --working-copy --concurrency=10 http://makefile.com/makefile.make platform |
This file contains hidden or 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
// Usage: @include transparent(#000, 0.6); | |
@mixin transparent($color, $alpha) { | |
$rgba: rgba($color, $alpha); | |
$ie-hex-str: ie-hex-str($rgba); | |
background-color: transparent; | |
background-color: $rgba; | |
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#{$ie-hex-str}, endColorstr=#{$ie-hex-str}); | |
zoom: 1; | |
} |
This file contains hidden or 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 | |
$sapi = php_sapi_name(); | |
if ($sapi === 'cli') { | |
print 'This is a cli request'; | |
} |
This file contains hidden or 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 | |
$field_name = 'field_name'; | |
$field = field_read_field($field_name); | |
$field['locked'] = 0; // 0: unlock; 1: lock. | |
field_update_field($field); |
This file contains hidden or 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
#!/usr/bin/env drush | |
<?php | |
/** | |
* Usage: " ./module_finder.drush metatag" | |
* Usage multiple modules: " ./module_finder.drush 'views|metatag" | |
*/ | |
// Get all aliases. | |
$aliases = _drush_sitealias_all_list(); |
This file contains hidden or 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 | |
class HotelMigration extends Migration { | |
public function __construct(array $arguments) { | |
parent::__construct($arguments); | |
$this->description = t('Import of hotels'); | |
$columns = array( | |
0 => array('StreetId', 'StreetId'), |