To have a gulp workflow that with a single process,
- watches for any sass changes, then compiles sass source into css
- watches for any changes in the public directory, triggers live-reload
- serves your static content in
public/
| -- Directus Database Cleanup Script | |
| -- Purpose: Remove orphaned data and optimize database performance in Directus CMS | |
| -- Tested on: Directus 11.2.2 Postgres 16.0 | |
| -- WARNING: Always backup your database before running cleanup scripts! | |
| -- DISCLAIMER: Use at your own risk! | |
| /** | |
| * Background: | |
| * During CMS development, especially with Directus, database structure changes frequently. |
| ## Must | |
| | **Array Method** | **Mutates Original?** | **Syntax** | **Parametreler** | **Return** | **Return Data Type** | | |
| |---------------------|------------------------------------|----------------------------------------------|----------------------------------------------------------------------------------|-------------------------------------------------|-----------------------------| | |
| | `forEach()` | Hayır | `arr.forEach(callback(currentValue, index?, array?))` | Callback fonksiyonu. | `undefined`. | `undefined` | | |
| | `map()` | Hayır | `arr.map(callback(currentValue, index?, array?))` | Callback fonksiyonu. | Her öğeyi değiştirilmiş ye |
| | **Array Method** | **Mutates Original?** | **Syntax** | **Parametreler** | **Return** | **Return Data Type** | | |
| |---------------------|------------------------------------|----------------------------------------------|----------------------------------------------------------------------------------|-------------------------------------------------|-----------------------------| | |
| | `push()` | Evet | `arr.push(element1, ..., elementN)` | Eklenecek bir veya daha fazla öğe. | Dizinin yeni uzunluğu. | `number` | | |
| | `pop()` | Evet | `arr.pop()` | Yok. | Kaldırılan öğe. |
| var domIsReady = (function(domIsReady) { | |
| var isBrowserIeOrNot = function() { | |
| return (!document.attachEvent || typeof document.attachEvent === "undefined" ? 'not-ie' : 'ie'); | |
| } | |
| domIsReady = function(callback) { | |
| if(callback && typeof callback === 'function'){ | |
| if(isBrowserIeOrNot() !== 'ie') { | |
| document.addEventListener("DOMContentLoaded", function() { | |
| return callback(); |
| # Moving from jQuery | |
| ## Events | |
| ```javascript | |
| // jQuery | |
| $(document).ready(function() { | |
| // code | |
| }) |