Skip to content

Instantly share code, notes, and snippets.

View turanibrahim's full-sized avatar

İbrahim Turan turanibrahim

View GitHub Profile
@turanibrahim
turanibrahim / settings.json
Created October 27, 2025 14:08
Bonjour settings
{
"about": {
"browser": "chrome",
"version": "21.2.1"
},
"showall": false,
"lang": "en",
"dark": "system",
"favicon": "",
"tabtitle": "",
@turanibrahim
turanibrahim / .eslintrc.cjs
Created August 30, 2023 23:15
Nuxt3 Airbnb Conf
require("@rushstack/eslint-patch/modern-module-resolution")
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
'vue/setup-compiler-macros': true
},
extends: [
@turanibrahim
turanibrahim / app.html
Last active August 15, 2023 12:23
Nuxt.js runtime env variables
<!DOCTYPE html>
<html lang="en" {{ HTML_ATTRS }}>
<head {{ HEAD_ATTRS }}>
{{ HEAD }}
<script type="module">
const initEnv=()=>{let e=document.querySelector("#env-variables");return e&&(window.env={...e.dataset}),window.env};initEnv();
</script>
</head>
<body {{ BODY_ATTRS }}>
{{ APP }}
@turanibrahim
turanibrahim / Example.vue
Last active January 9, 2023 16:30
Swiper `swiper-slide` that have auto width stuck on first load issue in Vue 3
<template>
<swiper
:slides-per-view="'auto'"
:space-between="30"
:observer="true" // Add this
:observe-parents="true" // Add this otherwise slider will stuck on first load
>
<swiper-slide>
Slide content that have unpredictible width for example image
</swiper-slide>
@turanibrahim
turanibrahim / Solution.vue
Last active January 9, 2023 10:45
Youtube video handler component
<script setup>
import {
nextTick, onBeforeUnmount, onMounted,
} from 'vue';
const randomNumber = Math.floor(Math.random() * 1000);
const videoId = `youtube-video-${randomNumber}`;
const props = defineProps({
height: { type: [String, Number], default: '200' },
@turanibrahim
turanibrahim / ExampleUsage.vue
Last active September 21, 2022 09:56
Phone number field validation
<script setup>
import { reactive } from 'vue';
import { Form } from 'vee-validate';
import VButton from '@ui/VButton.vue';
import VPhoneField from '@ui/VPhoneField.vue';
const initialForm = {
phoneNumber: {
dialCode: '',
phoneNumber: '',
@turanibrahim
turanibrahim / App.vue
Last active September 21, 2022 09:26
Vue 3 Failed to execute `insertBefore` on Node error
<script setup>
const route = useRoute();
const layouts = [
{
name: 'App',
component: AppLayout,
},
{
name: 'Default',
component: DefaultLayout,
@turanibrahim
turanibrahim / vite.config.js
Created August 10, 2022 08:09
Vite config for split chunks
/* eslint-disable import/no-extraneous-dependencies */
import path from 'path';
import { defineConfig, splitVendorChunkPlugin } from 'vite';
import vue from '@vitejs/plugin-vue';
export default defineConfig({
plugins: [
vue(),
splitVendorChunkPlugin(),
],
@turanibrahim
turanibrahim / README.md
Created June 9, 2022 19:27 — forked from zulhfreelancer/README.md
S3 Website + CloudFront - how to show index.html content when at /sub-directory/ path?

Problem

We have index.html file in S3 bucket under a folder called /about-us/. When checking in browser using CloudFront distribution link, custom-domain.com/about-us/ shows AccessDenied error.

But, custom-domain.com/about-us/index.html works fine and show content.

What we want

We want custom-domain.com/about-us/ to show the index.html content.

@turanibrahim
turanibrahim / gulpfile.js
Created August 11, 2021 17:08
Gulp example
const { src, dest, watch, series, parallel } = require('gulp');
const uglify = require('gulp-uglify');
const rename = require('gulp-rename');
const sass = require('gulp-sass')(require('sass'));
const cleanCSS = require('gulp-clean-css');
const webserver = require('gulp-webserver');
const clean = require('gulp-clean');
const eslint = require('gulp-eslint');
const browserify = require('browserify');
const log = require('gulplog');