Skip to content

Instantly share code, notes, and snippets.

View oyilmaztekin's full-sized avatar

Özer Y. oyilmaztekin

View GitHub Profile
@oyilmaztekin
oyilmaztekin / alis-gise-islemleri.svg
Last active January 28, 2020 12:26
svg compressions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@oyilmaztekin
oyilmaztekin / dataFromServer.js
Last active December 21, 2019 12:25
dataFromServer
const http = require("http");
const { readJSON } = require('./readFileJSON')
const server = http.createServer((req, res) => {
const pathName = req.url;
readJSON("data.json", "utf-8")
.then(data => {
if(pathName === "/"){
res.end(data);
@oyilmaztekin
oyilmaztekin / babel.config.js
Last active September 10, 2019 07:08
Jest Configuration
/* eslint-disable */
module.exports = function (api) {
api.cache(false);
if (process.env.NODE_ENV === "test") {
console.log("env: " + process.env.NODE_ENV);
return {
presets: [
"@babel/preset-react",
[
"@babel/preset-env",
const tabManager = ( function () {
const _tabElements = []
function _detectUrlType(src){
const urlStructure = {}
if(src.startsWith("http")){
urlStructure["type"] = "remote"
urlStructure["url"] = src
}
else{
const DataSetTree = [ { "ID": 2, "Phone": "(979) 486-1932", "City": "Chełm", "Name": "Scarlet", "children": [ { "ID": 30, "parentID": 2, "Phone": "(641) 756-7073", "City": "Harrison Hot Springs", "Name": "Hamilton", "children": [ { "ID": 54, "parentID": 30, "Phone": "(800) 876-5942", "City": "Ribnitz-Damgarten", "Name": "Kelsie", "children": [ { "ID": 62, "parentID": 54, "Phone": "(523) 159-2911", "City": "Biała Podlaska", "Name": "Clio", "children": [], "collapse": false, "child": true } ], "collapse": false, "child": true }, { "ID": 87, "parentID": 30, "Phone": "(500) 895-9220", "City": "Piracicaba", "Name": "Maya", "children": [], "collapse": false, "child": true } ], "collapse": false, "child": true }, { "ID": 40, "parentID": 2, "Phone": "(921) 336-7339", "City": "Namur", "Name": "Lionel", "children": [], "collapse": false, "child": true } ], "collapse": false }, { "ID": 3, "Phone": "(573) 685-8350", "City": "Wardha", "Name": "Adria", "children": [ { "ID": 4, "parentID": 3, "Phone": "(630) 292-9737", "Cit
@oyilmaztekin
oyilmaztekin / birthday-cake-candles.js
Last active October 21, 2018 19:07
Problem Solving
// You are in charge of the cake for your niece's birthday
// and have decided the cake will have one candle for each year of her total age.
// When she blows out the candles, she’ll only be able to blow out the tallest ones.
// Your task is to find out how many candles she can successfully blow out.
let ar = [3, 2, 1, 3, 2, 2, 2] // each element of array represents to size of candles
function birthdayCakeCandles(ar) {
let max = 0;
class Rectangle {
constructor(w, h) {
this.w = w;
this.h = h;
}
}
Rectangle.prototype.area = function(){
return this.w * this.h
}
function Person(firstname, lastname) {
this.firstname = firstname || 'Default';
this.lastname = lastname || 'Default2';
this.getFullName = function(firstname, lastname) {
return this.firstname + ' ' + this.lastname;
}
}
var jane = new Person('jane');
"Comment for Function": {
"prefix": "commentF",
"body": [
"/** DESCRIPTION ",
"* $1, $4, $7 ",
"* @param {${1:name}} {${2:type}} - [${3:description}]",
"* @param {${4:name}} {${5:type}} - [${6:description}]",
"* @return {${7:name}} {${8:type}} - [${9:description}]",
"*/ "
@oyilmaztekin
oyilmaztekin / Object-Literal.js
Last active June 24, 2021 15:46
Arrow Fonksiyonu nerelerde Kullanamayız
// OBJE METODU OLARAK TANIMLAYAMAYIZ
var calculate = {
array: [1, 2, 3],
sum: () => {
console.log(this === window); // => true
return this.array.reduce((result, item) => result + item);
},
sum2(){
console.log(this === window); // => false direk objeyi referans alır.