Skip to content

Instantly share code, notes, and snippets.

@JoyceBabu
JoyceBabu / Law-of-Demeter-with-PHP.md
Created January 3, 2021 17:47 — forked from k1paris/Law-of-Demeter-with-PHP.md
Law of Demeter with PHP (LoD)

Law of Demeter with PHP (LoD)

Law of Demeter or principle of least knowledge is a design guideline, that is using to make code more simple and stable.

Rules for module

  • Each unit should have only limited knowledge about other units: only units "closely" related to the current unit.
  • Each unit should only talk to his friends; don't talk to strangers.
  • Only talk to your immediate friends.
@JoyceBabu
JoyceBabu / location-search.js
Created May 18, 2022 06:07
Location search for Prokerala API
// Visit https://api.prokerala.com/demo/birth-details.php to see the following code in action
const PK_API_CLIENT_ID = '';
(function () {
function loadScript(cb) {
var script = document.createElement('script');
script.src = 'https://client-api.prokerala.com/static/js/location.min.js';
script.onload = cb;
script.async = 1;
document.head.appendChild(script);
}