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
<ol> | |
{% for key, value in _context %} | |
<li>{{ key }}</li> | |
{% endfor %} | |
</ol> | |
Or you can use: | |
{{ dump(_context|keys) }} |
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 pml --no-core --type=module --status=enabled --pipe | xargs drush -y dis |
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 | |
while ( have_posts() ) : the_post(); ?> <!--Because the_content() works only inside a WP Loop --> | |
<div class="entry-content-page"> | |
<?php the_content(); ?> <!-- Page Content --> | |
</div><!-- .entry-content-page --> | |
<?php | |
endwhile; //resetting the page loop | |
wp_reset_query(); //resetting the page query | |
?> |
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
isset($_GET['mykey']) ? $_GET['mykey'] : "" |
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
Sync DB between two boxes - drush sql-sync @dev @jasons | |
Sync files between two boxes - drush rsync @dev:%files @jasons:%files |
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 | |
// Generates a strong password of N length containing at least one lower case letter, | |
// one uppercase letter, one digit, and one special character. The remaining characters | |
// in the password are chosen at random from those four sets. | |
// | |
// The available characters in each set are user friendly - there are no ambiguous | |
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option, | |
// makes it much easier for users to manually type or speak their passwords. | |
// | |
// Note: the $add_dashes option will increase the length of the password by |
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 NAME_views_api() { | |
return array( | |
'api' => 3, | |
'path' => drupal_get_path('module', 'NAME'), | |
'template path' => drupal_get_path('module', 'NAME'), | |
); | |
} | |
This will tell Views to look in the root directory of your module. I personally am a fan of adding a subdirectory to the module to hold template files. To do this append the directory name to the end of the template path, eg: | |
'template path' => drupal_get_path('module', 'NAME') . '/templates', |
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
$rows = 1; | |
if (($handle = fopen("<path to csv file>", "r")) !== FALSE) { | |
echo '<table class="table table-bordered toggle-square-filled default breakpoint footable">'; | |
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { | |
$num = count($data); | |
if ($rows == 1) { | |
echo '<thead><tr>'; |
NewerOlder