Skip to content

Instantly share code, notes, and snippets.

name: MH_Seadan_Snippets
description: ''
host: EXCEL
api_set: {}
script:
content: |
/** @CustomFunction */
function regex_format_sku(value) {
if (!value) {
return "";
@MichaelHabib
MichaelHabib / devilbox_docker-compose_20200309-2301.log
Last active March 9, 2020 12:01
docker-compose log in relation to postgree db issue
httpd_1 | [INFO] vhost-gen: no customized template found
httpd_1 | root $ sed -i'' 's/__PHP_ENABLE__/yes/g' /etc/vhost-gen/main.yml
httpd_1 | root $ sed -i'' 's/__PHP_ADDR__/172.16.238.10/g' /etc/vhost-gen/main.yml
httpd_1 | root $ sed -i'' 's/__PHP_PORT__/9000/g' /etc/vhost-gen/main.yml
httpd_1 | root $ sed -i'' 's/__PHP_TIMEOUT__/180/g' /etc/vhost-gen/main.yml
httpd_1 | root $ sed -i'' 's/__PHP_ENABLE__/yes/g' /etc/vhost-gen/mass.yml
httpd_1 | root $ sed -i'' 's/__PHP_ADDR__/172.16.238.10/g' /etc/vhost-gen/mass.yml
httpd_1 | root $ sed -i'' 's/__PHP_PORT__/9000/g' /etc/vhost-gen/mass.yml
httpd_1 | root $ sed -i'' 's/__PHP_TIMEOUT__/180/g' /etc/vhost-gen/mass.yml
httpd_1 | root $ sed -i'' 's/__DOCKER_LOGS_ERROR__/no/g' /etc/vhost-gen/main.yml
@MichaelHabib
MichaelHabib / devilbox_env_20200309-2302.env
Last active March 9, 2020 12:02
devilbox .env file in relation to postgre db issue
###
### ---------------------------------------------------
### D E V I L B O X R U N - T I M E S E T T I N G S
### ---------------------------------------------------
###
### All the following settings are applied during
### $ docker-compose up
###
### No need to rebuild any docker images!
###
@MichaelHabib
MichaelHabib / css_folder_structure.css
Created July 30, 2019 00:10
CSS Folder Structure Tree : Show a list as a folder structure ...
.tree, .tree * {
font-size: 16px
}
.tree ul,
.tree li,
.tree ol
{
margin : 0px;
list-style-type: none;
}
@MichaelHabib
MichaelHabib / octobercms_how-to-parse-twig-and-bracket-variables -from-string-or-field.php
Last active November 1, 2018 06:01
October CMS : How to parse twig & bracket variables stored in a string or a field ?
// parsing twig
$theme = Cms\Classes\Theme::getActiveTheme();
if(($stringContainingTwig = $this['page']['meta_title']) !== null ){
$page_meta_title = Twig::parse($stringContainingTwig, [
'varName' => "variable value!",
'separator' => $theme->title_separator ?: ' _ ' ,
'title' => $this['page']['title'],
'business_name' => $theme->business_name,
]);