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 | |
/** | |
* @file | |
* An example of how to create a new Drush command which wraps an existing command, allowing some customisation. | |
* | |
* Note any file containing this snippet should be suffixed '.drush.inc', not '.drush.inc.php'. | |
*/ | |
/* Implements COMMANDFILE_drush_command(). */ | |
function sql_sync_wrapper_drush_command() { |
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/sh | |
FILE_FORMAT="JPG" | |
# Show dates of all JPG files in current directory, in human readable format. | |
exiftool -d '%r %a, %B %e, %Y' -DateTimeOriginal -S -s -ext $FILE_FORMAT . | |
# Fiddle the dates - some date fields forward. | |
# Format is Y:M:D h:m:s | |
exiftool -F -AllDates+="2:6:0 0" *$FILE_FORMAT |
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
# Output longest line to bigfile.txt | |
cat ./local.sql | awk ' { if ( length > x ) { x = length; y = $0 } }END{ print y }' > bigfile.txt | |
# Count characters in longest line | |
cat ./local.sql | awk ' { if ( length > x ) { x = length; y = $0 } }END{ print y }' | wc -m |
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 | |
// We assume that a custom module is implementing a file formatter | |
// called 'mymodule_custom_file_formatter'. | |
$filetype = 'video'; // File type to alter file display for. | |
$display = 'preview'; // File display to alter - 'default', 'teaser' or 'preview'. | |
$video_display = file_display_new($filetype, $display, 'mymodule_custom_file_formatter'); | |
$video_display->export_type = 1; |
NewerOlder