PHP: Quick Helper Functions
This is a small collection of quick helper functions for debugging and working with PHP.
Functions
axyz_d()
axyz_d( $var )
This is a small collection of quick helper functions for debugging and working with PHP.
axyz_d( $var )
#!/usr/bin/env python3 | |
# coding: utf-8 | |
# Sets the correct content-type and content-encoding for Unity3D files. | |
# @see https://forum.unity.com/threads/changes-to-the-webgl-loader-and-templates-introduced-in-unity-2020-1.817698/#post-5716621 | |
import boto3 | |
bucket_id = 'unity-model' | |
folder_prefix = 'model' |
<?php | |
if ( ( strpos( $url, 'http://' ) === false ) && ( strpos( $url, 'https://' ) === false ) ) { | |
$url = 'http://' . $url; | |
} |
<?php | |
foreach ( $foobar as $key => $value ) { | |
if ( preg_match('/^barfoo-/', $key) ) { | |
// Array entries of $foobar whose keys starts with barfoo- | |
} | |
} |
<?php | |
$id = $modx->resource->get('id'); | |
$parents = $modx->getParentIds($id, 2); | |
$grandparent = $parents[1]; | |
return $grandparent; |
<?php | |
setlocale(LC_ALL, 'en_US'); | |
return strftime($options, $input); |
# Temporary files | |
*~ | |
*.swp | |
# Metadata | |
.DS_Store | |
Thumbs.db |
# PHP | |
php_flag register_globals off | |
php_flag short_open_tag off | |
# Set default charset to UTF-8 | |
AddDefaultCharset UTF-8 | |
# File types |
# Temporary files | |
*~ | |
*.swp | |
# Metadata | |
.DS_Store | |
Thumbs.db |
<snippet> | |
<content><![CDATA[sub ${1:function_name} { | |
${0:# Code ...} | |
} | |
]]></content> | |
<tabTrigger>sub</tabTrigger> | |
<scope>source.perl</scope> | |
<description>Subroutine</description> | |
</snippet> |