Skip to content

Instantly share code, notes, and snippets.

@gokhanozdemir
gokhanozdemir / directus-cleanup-orphan-rows.sql
Last active January 14, 2025 17:27
By implementing the provided SQL script, users can proactively address these issues, ensuring their Directus instance remains efficient, organized, and aligned with their evolving content management needs.
-- 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.
@gokhanozdemir
gokhanozdemir / CheatSheet - Array Methodları Seviye 2
Last active March 21, 2025 13:15
JavaScript'te sık kullanılan dizi metodları.
## 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
@gokhanozdemir
gokhanozdemir / CheatSheet - Array Methodları Seviye I
Last active February 12, 2025 17:13
JavaScript'te sık kullanılan dizi metodları.
| **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.
@gokhanozdemir
gokhanozdemir / domIsReady.js
Created February 23, 2017 13:57 — forked from devbyray/domIsReady.js
Vanilla JavaScript Document Ready (Cross-Browser)
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();
@gokhanozdemir
gokhanozdemir / Vanilla JS vs jQuery
Created February 22, 2017 14:44 — forked from erlendmrgist/Vanilla JS vs jQuery
Vanilla JS vs jQuery
# Moving from jQuery
## Events
```javascript
// jQuery
$(document).ready(function() {
// code
})
@gokhanozdemir
gokhanozdemir / README.md
Created November 1, 2016 17:17 — forked from theRemix/README.md
The Holy Grail - Gulp + Sass + LiveReload + Foundation

Gulp + Sass + LiveReload + Foundation

Goals

To have a gulp workflow that with a single process,

  1. watches for any sass changes, then compiles sass source into css
  2. watches for any changes in the public directory, triggers live-reload
  3. serves your static content in public/