Skip to content

Instantly share code, notes, and snippets.

View chntrkss's full-sized avatar
🎯
Focusing

Cihan chntrkss

🎯
Focusing
View GitHub Profile
@chntrkss
chntrkss / settings.json
Created September 8, 2023 18:36
vscode-settings
{
"[svg]": {
"editor.defaultFormatter": "jock.svg"
},
"auto-rename-tag.activationOnLanguage": ["*"],
"chatgpt.gpt3.apiKey": "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",
"chatgpt.lang": "en",
"chatgpt.model": "gpt-3.5-turbo",
"codemetrics.basics.CodeLensEnabled": false,
"codesnap.backgroundColor": "#fcc9dd",
{"name":"vscode-harry","settings":"{\"settings\":\"{\\r\\n\\t\\\"[svg]\\\": {\\r\\n\\t\\t\\\"editor.defaultFormatter\\\": \\\"jock.svg\\\"\\r\\n\\t},\\r\\n\\t\\\"auto-rename-tag.activationOnLanguage\\\": [\\\"*\\\"],\\r\\n\\t\\\"chatgpt.gpt3.apiKey\\\": \\\"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\\\",\\r\\n\\t\\\"chatgpt.lang\\\": \\\"en\\\",\\r\\n\\t\\\"chatgpt.model\\\": \\\"gpt-3.5-turbo\\\",\\r\\n\\t\\\"codemetrics.basics.CodeLensEnabled\\\": false,\\r\\n\\t\\\"codesnap.backgroundColor\\\": \\\"#fcc9dd\\\",\\r\\n\\t\\\"diffEditor.wordWrap\\\": \\\"off\\\",\\r\\n\\t\\\"editor.autoClosingDelete\\\": \\\"never\\\",\\r\\n\\t\\\"editor.bracketPairColorization.enabled\\\": true,\\r\\n\\t\\\"editor.bracketPairColorization.independentColorPoolPerBracketType\\\": true,\\r\\n\\t\\\"editor.codeActionsOnSave\\\": {\\r\\n\\t\\t\\\"source.fixAll.tslint\\\": true\\r\\n\\t},\\r\\n\\t\\\"editor.cursorBlinking\\\": \\\"expand\\\",\\r\\n\\t\\\"editor.cursorSmoothCaretAnimation\\\": \\\"on\\\",\\r\\n\\t\\\"editor
@chntrkss
chntrkss / class.md
Created March 29, 2023 15:38
Prototip zincirleri ve Class'lar (Prototype chains and Classes)

Prototip zincirleri ve Class'lar (Prototype chains and Classes)

Orjinal Makale

Bu makalede, JavaScript'in Nesne Yönelimli Programlama (Object Oriented Programming) stili dört adımda tanıtılmaktadır.

  1. Tek object'ler: JavaScript'in temel OOP yapı taşları olan object'ler, tek başına nasıl çalışır?
  2. Prototip zincirleri: Her object'in sıfır veya daha fazla prototip zinciri (prototype chain) vardır. Prototipler, JavaScript'in temel kalıtım mekanizmasıdır (inheritance mechanism).
  3. Class'lar: JavaScript'in class'ları, object'ler için fabrikalardır. Bir class ve örnekleri arasındaki ilişki prototip kalıtımı (prototypical inheritance) temel alır.
  4. Subclassing: Bir alt class ile onun üst class'ı arasındaki ilişki de prototip kalıtımı temel alır.
@chntrkss
chntrkss / index.js
Created September 9, 2022 12:14
Map
const extensionThree = '.js'
const extensionMap = new Map()
extensionMap.set('.css', 'text/css')
extensionMap.set('.js', 'text/javascript')
extensionMap.set('.json', 'application/json')
console.log(extensionMap.get(extensionThree) || 'text/html') // "text/javascript"
@chntrkss
chntrkss / index.js
Last active September 9, 2022 12:16
Object
const extensionTwo = '.js';
const extensionObject = {
'.css': 'text/css',
'.js': 'text/javascript',
'.json': 'application/json',
'.html': 'text/html',
}
console.log(extensionObject[extensionTwo] || extensionObject['.html']) // "text/javascript"
@chntrkss
chntrkss / index.js
Last active September 9, 2022 12:16
Switch-Case
const extension = '.js'
let contentType = ''
switch (extension) {
case '.css':
contentType = 'text/css'
break
case '.js':
contentType = 'text/javascript'
@chntrkss
chntrkss / App.jsx
Last active September 2, 2022 12:15
DOM Accesing with useRef
import { useRef } from "react"
function App() {
const textInputRef = useRef()
const buttonClick = () => textInputRef.current?.focus()
return (
<div>
@chntrkss
chntrkss / App.jsx
Last active August 30, 2022 13:46
useRef-1
import { useRef } from 'react'
export default function App() {
const myRef = useRef(0)
console.log(myRef) // {current: 0}
console.log(myRef.current) // 0
return (

HTML5 CSS Sass Bootstrap JavaScript TypeScript Vue Nodejs

  • 🛢   MongoDB
╔═══════════════╦══════════╦═══════════════════════════════════════════════════════════╗
║HTTP Methotları║ Scope ║ Semantics ║
╠═══════════════╬══════════╬═══════════════════════════════════════════════════════════╣
║ GET ║Collection║Bir koleksiyondaki tüm kaynakları alın ║
║ GET ║Collection║Tek bir kaynak al ║
║ HEAD ║Collection║Bir koleksiyondaki tüm kaynakları alın (header only) ║
║ HEAD ║Resource ║Tek bir kaynak al (header only) ║
║ POST ║Collection║Koleksiyonda yeni bir kaynak oluşturun ║
║ PUT ║Resource ║Bir kaynağı güncelleme ║
║ PATCH ║Resource ║Bir kaynağı güncelleme ║