Skip to content

Instantly share code, notes, and snippets.

@gokhancerk
gokhancerk / gist:65ccd53f9a6a06e6719f3a283d819785
Created September 30, 2023 20:39 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@gokhancerk
gokhancerk / Test.jsx
Created September 14, 2023 19:57 — forked from DemianKost/Test.jsx
Everything that you need to create a new Laravel application with React.js, Inertia.js and Vite.js
import React, { useState } from 'react';
const Test = () => {
return (
<h1>This is test component</h1>
)
}
export default Test
@gokhancerk
gokhancerk / readme.md
Created November 1, 2022 08:24 — forked from oliveratgithub/readme.md
Configure the PHP CLI in macOS to use MAMP PHP binaries

Pre-requisites

Find MAMP's installed PHP version(s) you want to use the PHP CLI for:

$ ls -l /Applications/MAMP/bin/php/

Configure PHP CLI in macOS to use MAMP's PHP

  1. First, open your local user's .bash_profile in edit mode, in order to add aliases for accessing the PHP CLI locally
$ pico ~/.bash_profile
@gokhancerk
gokhancerk / index.html
Created April 3, 2022 09:16
to add a React component to an existing HTML page.
<html>
<body>
<div id="app"></div>
</body>
<script
src="https://unpkg.com/react@18/umd/react.development.js"
crossorigin
></script>
<script
@gokhancerk
gokhancerk / git-cheetsheet.md
Created November 25, 2021 15:22
Git cheethsheet

Remote değişiklikleri local'e almak

  git fetch origin
  git log origin/main // değişiklik yapılan commitler
  git fetch // Remote branch'deki değişiklikleri indirir
  git pull // local branch'inize entegre eder

Git pull komutu aslında arka arkaya iki şey yapmanızı sağlar

@gokhancerk
gokhancerk / react-redux.js
Last active November 23, 2021 07:09
react-redux cheetsheet
// reducer
const person = {
name: '',
age: '',
national:''
}
export const personReducer = (state = person, action) => {
switch (action.type) {
case 'NAME':
return {...state, name: action.payload}
@gokhancerk
gokhancerk / axios-catch-error.js
Created September 2, 2021 06:50 — forked from fgilio/axios-catch-error.js
Catch request errors with Axios
/*
* Handling Errors using async/await
* Has to be used inside an async function
*/
try {
const response = await axios.get('https://your.site/api/v1/bla/ble/bli');
// Success 🎉
console.log(response);
} catch (error) {
// Error 😨
@gokhancerk
gokhancerk / App.js
Created August 24, 2021 08:40
redux cheetsheet
import { connect } from "react-redux";
function App(props){
return (
<div>App</div>
);
}
// reducer içindeki state'e erişir, state'in içindeki değerlerden hangisini istersek onu return eder
@gokhancerk
gokhancerk / media-query.css
Created July 21, 2021 10:03 — forked from gokulkrishh/media-query.css
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@gokhancerk
gokhancerk / null vs undefined karmaşası.md
Last active July 8, 2021 06:41
null vs undefined karmaşası

JS öğrenirken genelde null değerine boş değer denilip geçilir herhalde öğrenenin kafası karışmasın diye detaya girmiyor instructorlar fakat bu sefer undefined ile karıştırılabiliyor ve bunun ayrımını yapmak bir karmaşaya dönüşmeye başlıyor.

bu değerlerin typeof'una bakıldığında

typeof null // object
typeof undefined // undefined