A list of tools detect what CMS / server / os is used for a website

Sometime, when you found a site looked amazing and functional, you want to know what technology / platform / CMS that was used for building that site. The following is a list of tools that can help you check what kind of components that the site operates with.

But you may also wonder how these online CMS / platform detection work. I think by checking the site urls, and file extensions, HTTP response headers, source code for comments, or standard JS libraries, it could give some clues, as CMS using combinations of components can leave some unique libs and patterns, exactly as "signatures" of a particular platform.

https://builtwith.com/

https://w3techs.com/

http://guess.scritch.org/

https://wappalyzer.com/

NPath complexity and cyclomatic complexity explained

Both terms are used to determine the complexity of code. It's always good to keep your code simple and readable as referred in KISS principle.

CyclomaticComplexity
https://phpmd.org/rules/codesize.html

Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

NPath complexity

The NPath complexity of a method is the number of acyclic execution paths through that method.

References:

ttps://www.tutorialspoint.com/softwaretestingdictionary/cyclomatic_complexity.htm

https://modess.io/npath-complexity-cyclomatic-complexity-explained/

Markup accessing page parameters as object or array for OctoberCMS

You can access the current URL parameters via this.param and it returns a PHP array.

Accessing page parameters

This example demonstrates how to access the tab URL parameter in a page.

url = "/account/:tab"
==
{% if this.param.tab == 'details' %}

    

Here are all your details

{% elseif this.param.tab == 'history' %}

You are viewing a blast from the past

{% endif %}

If the parameter name is also a variable, then array syntax can be used.

url = "/account/:post_id"
==
{% set name = 'post_id' %}

The post ID is: {{ this.param[name] }}

reference: https://octobercms.com/docs/markup/this-param

Detect iOS in OctoberCMS to differ the script or other resources loads

in the "code" section of the CMS page editor

put in below codes

function onStart()
{
 //Detect special conditions devices
 $iPod = stripos($_SERVER['HTTP_USER_AGENT'],"iPod");
 $iPhone = stripos($_SERVER['HTTP_USER_AGENT'],"iPhone");
 $iPad = stripos($_SERVER['HTTP_USER_AGENT'],"iPad");
 $Android = stripos($_SERVER['HTTP_USER_AGENT'],"Android");
 $webOS = stripos($_SERVER['HTTP_USER_AGENT'],"webOS");

 $this['isIos'] = false;

 //do something with this information
 if( $iPod || $iPhone ) {
 //browser reported as an iPhone/iPod touch -- do something here
 $this['isIos']= true;
 } else if($iPad) {
 //browser reported as an iPad -- do something here
 $this['isIos']= true;
 } else if($Android) {
 //browser reported as an Android device -- do something here
 $this['isIos']= false;
 } else if($webOS) {
 //browser reported as a webOS device -- do something here
 $this['isIos']= false;
 }
 //var_dump($this['isIos']);
}

then you can call the isIos variables in html section

{% if isIos %}
{% partial "some-partial-for-ios" %}
{% else %}
{% partial "some-partial-not-for-ios" %}
{% endif %}

reference: http://stackoverflow.com/questions/6322112/check-if-php-page-is-accessed-from-an-ios-device

 

TCPDF – PHP library for generating PDF documents on-the-fly

This is a PDF generation library that does not require external libraries for basic functions, image processing will need GD but that's all.

In short this is a PDF generator lib with minimum system requirements, you can integrate it to some older projects.

So if you have an old server with PHP 5.2 / 5.3 and can not install anything like ImageMagicX, you can try this out.

Main Features:

  • no external libraries are required for the basic functions;

  • all standard page formats, custom page formats, custom margins and units of measure;

  • UTF-8 Unicode and Right-To-Left languages;

  • TrueTypeUnicode, OpenTypeUnicode v1, TrueType, OpenType v1, Type1 and CID-0 fonts;

  • font subsetting;

  • methods to publish some XHTML + CSS code, Javascript and Forms;

  • images, graphic (geometric figures) and transformation methods;

  • supports JPEG, PNG and SVG images natively, all images supported by GD (GD, GD2, GD2PART, GIF, JPEG, PNG, BMP, XBM, XPM) and all images supported via ImagMagick (http://www.imagemagick.org/script/formats.php)

  • 1D and 2D barcodes: CODE 39, ANSI MH10.8M-1983, USD-3, 3 of 9, CODE 93, USS-93, Standard 2 of 5, Interleaved 2 of 5, CODE 128 A/B/C, 2 and 5 Digits UPC-Based Extension, EAN 8, EAN 13, UPC-A, UPC-E, MSI, POSTNET, PLANET, RMS4CC (Royal Mail 4-state Customer Code), CBC (Customer Bar Code), KIX (Klant index - Customer index), Intelligent Mail Barcode, Onecode, USPS-B-3200, CODABAR, CODE 11, PHARMACODE, PHARMACODE TWO-TRACKS, Datamatrix, QR-Code, PDF417;

  • JPEG and PNG ICC profiles, Grayscale, RGB, CMYK, Spot Colors and Transparencies;

  • automatic page header and footer management;

  • document encryption up to 256 bit and digital signature certifications;

  • transactions to UNDO commands;

  • PDF annotations, including links, text and file attachments;

  • text rendering modes (fill, stroke and clipping);

  • multiple columns mode;

  • no-write page regions;

  • bookmarks, named destinations and table of content;

  • text hyphenation;

  • text stretching and spacing (tracking);

  • automatic page break, line break and text alignments including justification;

  • automatic page numbering and page groups;

  • move and delete pages;

  • page compression (requires php-zlib extension);

  • XOBject Templates;

  • Layers and object visibility.

  • PDF/A-1b support.

on GitHub: https://github.com/tecnickcom/TCPDF

 

Using .on for dynamically generated elements $(document).on jQuery

This is an issue that usually beginner would encounter when things like .hover and .click did not work with dynamically generated elements.

To resolve the issue, instead of using element.click(), $(document).on("click", "element_selector", function() should be used for live contents. Note that the .hover takes two callback functions, in order to achieve the same effect, mouseenter and mouseleave events should be put in when using $(document).on in this case.

$(document).on("mouseenter", "li", function() {
    // hover starts code here
});

$(document).on("mouseleave", "li", function() {
    // hover ends code here
});

reference: http://stackoverflow.com/questions/14950321/how-to-bind-hover-to-dynamically-created-li-elemtent

 

 

jQuery store locator plugin

The jQuery store locator plugin can easily help you to create a feature rich widget for your website or web application.

Demos:

Tutorials

On github: https://github.com/bjorn2404/jQuery-Store-Locator-Plugin

Author blog: http://www.bjornblog.com/web/jquery-store-locator-plugin/comment-page-3

Magento Marketplace / B2B related extensions and solutions

Found some of the Magento extensions are quite sophisiticated and built-ready, while searching for the B2B solutions.

These could help you to come up with a Magento B2B / Marketplace e-commerce platform very quick.

Magento Builder Theme
https://www.magentocommerce.com/magento-connect/frontend-builder-theme.html ($9.00)

B2B / Market place
[Recommended] https://www.magentocommerce.com/magento-connect/marketplace.html (Magento Marketplace Multi Vendor Module US$349.00)
[Membership addon] http://webkul.com/blog/magento-marketplace-membership/ (US$149.00)
[Marketplace Mobile App] https://www.magentocommerce.com/magento-connect/marketplace-mobile-app.html (US$599.00)
author: https://www.magentocommerce.com/magento-connect/developer/webkul
https://www.magentocommerce.com/magento-connect/b2b-suite.html (US$250.00)
https://www.magentocommerce.com/magento-connect/marketplace-2.html (FREE)

Membership
https://www.magentocommerce.com/magento-connect/membership-program-for-magento.html (US$199.00)
https://www.magentocommerce.com/magento-connect/marketplace-membership.html (US$149.00)
https://www.magentocommerce.com/magento-connect/membership-subscription.html (US$149.00)
OR build with Magento recurring profile (membership as a vitual product with recurring payment requirement):
http://docs.magento.com/m1/ce/user_guide/catalog/product-recurring-profile.html

Payment gateway - WestPac and eWay
https://www.magentocommerce.com/magento-connect/fontis-westpac-payway-and-quickgateway.html (FREE) [up to Magento 1.7]
https://www.magentocommerce.com/magento-connect/fontis-eway-au.html (FREE) [eWay transaction fee: 1.6% per transaction]
https://www.magentocommerce.com/magento-connect/eway-rapid-australia.html (FREE)

Vtiger CRM Integration
https://www.magentocommerce.com/magento-connect/vtiger-magento-integration.html (US$299.99)
https://www.magentocommerce.com/magento-connect/vtiger-crm-integration.html (US$149.00)

Laravel E-commerce payment gateway packages

Laravel payment gateway solutions

Omnipay package
https://github.com/thephpleague/omnipay
Payway
https://github.com/Moult/omnipay-payway
PayPal on Laravel 5.2 code example
https://laracasts.com/discuss/channels/laravel/paypal-on-laravel-5222

 

WestPac payway official document
https://www.westpac.com.au/business-banking/merchant-services/online-payments/
https://www.payway.com.au/downloads/WBC/PayWay_API_Developers_Guide.pdf

Perfect Responsive Background Image solutions – Backstretch jQuery plugin

Backstretch - jQuery plugin - responsive background image plugin

Backstretch is a simple jQuery plugin that allows you to add a dynamically-resized, slideshow-capable background image to any page or element. The image will stretch to fit the page/element, and will automatically resize as the window/element size changes. http://srobbin.com/jquery-plugins/backstretch/

Backstretch on GitHub: https://github.com/srobbin/jquery-backstretch

Other references:

https://css-tricks.com/perfect-full-page-background-image/

OR change the image via @media query
use different images for @media query
https://teamtreehouse.com/community/how-to-create-a-responsive-div-with-a-background-image
OR CSS
http://stackoverflow.com/questions/12609110/responsive-css-background-images

bestplugins.com – plugin search engine for applications, browsers, CMS and more

 

ABOUT Bestplugins.com

BestPlugins is a team of dedicated web wizards, dedicated to empowering webmasters and web enthusiasts with knowledge that matters! At BestPlugins, we are all about telling you how. Plugins can give a functional makeover to applications, web browsers, CMS platforms and audio applications. We intend to facilitate really value adding information about the greatest plugins out there, so that our viewers can pick the great from the good and rub off the greatness to their web projects.

I've found this site helpful when searching for the plugins for my next project.

http://www.bestplugins.com/

Comparing Blade and Twig templates in Laravel

Blade and Twig, which one is better ? which one will be your choice?

Let's read through the comparison article listed here: Comparing Blade and Twig templates in Laravel

In my company, we use Twig instead of Blade for our Laravel projects. I know there are a lot of developers that also prefer Twig over Blade. So the question‘Why choose Twig over Blade?’ often pops up. The reason is usually just a matter of preference, but in this post we’re going to compare the Blade and Twig templating engines side-by-side.

link: https://medium.com/@barryvdh/comparing-blade-and-twig-templates-in-laravel-187fde7fcac9

ASP.NET – Publish to a Linux Production Environment

Publish to a Linux Production Environment

Found this handy to help transferring some of the ASP.NET projects to Linux, the goal is to eventually get away from Windows Servers.

In this guide, we will cover setting up a production-ready ASP.NET environment on an Ubuntu 14.04 Server.

We will take an existing ASP.NET Core application and place it behind a reverse-proxy server. We will then setup the reverse-proxy server to forward requests to our Kestrel web server.

Additionally we will ensure our web application runs on startup as a daemon and configure a process management tool to help restart our web application in the event of a crash to guarantee high availability.

Link: https://github.com/aspnet/Docs/blob/master/aspnet/publishing/linuxproduction.rst

reference: https://docs.asp.net/en/latest/publishing/linuxproduction.html

Magento Cards/Knowledge, Developer reference, Code Snippets, and netz98 magerun CLI tools

Some of the useful Magento tools and references:

Magento Code Snippets

This GitHub page gives you a lot of very useful Magento Code Snippets

https://gist.github.com/arosenhagen/2397824

 

netz98 magerun CLI tools

The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API. http://magerun.net/

on GitHub: https://github.com/netz98/n98-magerun

Magento cards

A simple knowledge base for Magento development including code snippets, tips and tricks, commands, configurations and many more other topics.

https://makandracards.com/magento

Magento for Developers: Part 4—Magento Layouts, Blocks and Templates

The official dev guide for Magento 1.x

http://devdocs.magento.com/guides/m1x/magefordev/mage-for-dev-4.html