This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const scrollDistance = (callback, refresh) => { | |
| if (!callback || typeof callback !== 'function') return | |
| let isScrolling, start, end, distance | |
| window.addEventListener('scroll', event => { | |
| if (!start) { | |
| start = window.pageYOffset | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export default () => { | |
| let docElem = document.documentElement | |
| let active = false | |
| let hasDeactivated = false | |
| let eventsBound = false | |
| let mouseWheelHandler | |
| let scrollHandler | |
| const scrollCallback = (offset, event, callback) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const obj = { | |
| name: 'Erdem', | |
| surname: 'Arslan' | |
| } | |
| const onChange = (watch, callback) => { | |
| const handler = { | |
| get (target, prop, receiver) { | |
| callback(target, prop, receiver) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [...Array(10).keys()] | |
| // [1, 2, 3, 4, 5, 6, 7, 8, 9] | |
| [...Array({ one:'1' }, { two: '2' }, { three: '3' }).keys()] | |
| // [1, 2, 3] | |
| let arr1 = [1, 2, 3] | |
| let arr2 = [2, 3, 4] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let array = [] | |
| // Joins two or more arrays, and returns a copy of the joined arrays | |
| array.concat(otherArray) | |
| // Copies array elements within the array, to and from specified positions | |
| array.copyWithin(target, start, end) | |
| // Returns a key/value pair Array Iteration Object | |
| array.entries() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const http2 = require('http2'); | |
| const fs = require('fs'); | |
| const path = require('path'); | |
| const zlib = require('zlib'); | |
| const brotli = require('brotli'); // npm package | |
| const PORT = 3032; | |
| const BROTLI_QUALITY = 11; // slow, but we're caching so who cares | |
| const STATIC_DIRECTORY = path.resolve(__dirname, '../dist/'); | |
| const cache = {}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Vue from 'vue' | |
| import axios from 'axios' | |
| import store from '../store' | |
| import { TokenService } from '../services/storage.service' | |
| // Full config: https://github.com/axios/axios#request-config | |
| let config = { | |
| baseURL: | |
| process.env.baseURL || |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| String.prototype.turkishtoEnglish = function () { | |
| return this.replace('Ğ','g') | |
| .replace('Ü','u') | |
| .replace('Ş','s') | |
| .replace('I','i') | |
| .replace('İ','i') | |
| .replace('Ö','o') | |
| .replace('Ç','c') | |
| .replace('ğ','g') | |
| .replace('ü','u') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function apiConnect(apiKey) { | |
| function get(route) { | |
| return fetch(`${route}?key=${apiKey}`) | |
| } | |
| function post(route, params) { | |
| return fetch(route, { | |
| method: 'POST', | |
| body: JSON.stringify(params), | |
| headers: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <style type="text/css"> | |
| .gaye-modal--modal { | |
| width: 100%; | |
| height: 100%; | |
| position: fixed; | |
| top: 0; left: 0; | |
| z-index: 9999; | |
| background-color: rgba(0, 0, 0, 0.5); |