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
<snippet> | |
<content><![CDATA[sub ${1:function_name} { | |
${0:# Code ...} | |
} | |
]]></content> | |
<tabTrigger>sub</tabTrigger> | |
<scope>source.perl</scope> | |
<description>Subroutine</description> | |
</snippet> |
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 | |
php_flag register_globals off | |
php_flag short_open_tag off | |
# Set default charset to UTF-8 | |
AddDefaultCharset UTF-8 | |
# File types |
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 | |
setlocale(LC_ALL, 'en_US'); | |
return strftime($options, $input); |
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 | |
$id = $modx->resource->get('id'); | |
$parents = $modx->getParentIds($id, 2); | |
$grandparent = $parents[1]; | |
return $grandparent; |
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 | |
foreach ( $foobar as $key => $value ) { | |
if ( preg_match('/^barfoo-/', $key) ) { | |
// Array entries of $foobar whose keys starts with barfoo- | |
} | |
} |
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 | |
if ( ( strpos( $url, 'http://' ) === false ) && ( strpos( $url, 'https://' ) === false ) ) { | |
$url = 'http://' . $url; | |
} |
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
Show hidden characters
{ | |
"cmd": ["perl", "-w", "$file"], | |
"file_regex": ".* at (.*) line ([0-9]*)", | |
"selector": "source.perl" | |
} |
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
# Temporary files | |
*~ | |
*.swp | |
# Metadata | |
.DS_Store | |
Thumbs.db |
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
# Temporary files | |
*~ | |
*.swp | |
# Metadata | |
.DS_Store | |
Thumbs.db |
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 | |
// Add this code to the themes functions.php | |
const GOOGLE_MAPS_API_KEY = 'Your Google Maps API Key'; | |
// Ensure Advanced Custom Fields Pro (ACF Pro) is enabled | |
// | |
// Check if plugin is enabled without additionally include the plugin manager for is_plugin_active() | |
// @see https://developer.wordpress.org/reference/functions/is_plugin_active/#comment-2427 | |
if ( in_array( 'advanced-custom-fields-pro/acf.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) { |
OlderNewer