Skip to content

Instantly share code, notes, and snippets.

@Akifcan
Akifcan / calendar.js
Created August 11, 2022 07:11
Calendar
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@Akifcan
Akifcan / schedule.js
Created July 23, 2022 23:50
My task scheduling implementation
const schedules = [{
id: 'a',
fun() {
console.log('a dependency run!')
},
depends_on: ['b', 'c']
},
{
id: 'b',
fun() {
@Akifcan
Akifcan / flat.js
Created July 10, 2022 11:40
Flatten
const x = [[5, 3, 2], 5, 1, 99, [3, [4, 5]]]
const flatten = []
function myFlat(arr){
arr.forEach(i => {
if(Array.isArray(i)){
myFlat(i)
@Akifcan
Akifcan / map.js
Created July 10, 2022 09:08
My own map implementation in javascript
const people = [
{
name: 'akif',
status: 'full stack developer'
},
{
name: 'sebnem ferah ❤❤',
status: 'artist'
},
]
@Akifcan
Akifcan / split.js
Created July 10, 2022 08:26
My own split implementation in javascript
const mySplit = (str, part) => {
const arr = []
let currentWorld = ''
for(let i = 0; i<str.length; i++){
const current = str[i]
if(current !== part){
currentWorld+=current
}
if(current === part || str.length - 1 === i){
arr.push(currentWorld)
@Akifcan
Akifcan / missing-number.js
Created May 4, 2022 10:20
Missing Number
const profile = {
name: 'peter',
age: 55,
kids: [{
name: 'jil',
age: 23
},
{
name: 'peter',
age: 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
@Akifcan
Akifcan / arguments
Created April 28, 2022 19:43
arguments example
function y(z){
console.log(arguments.length)
}
var x = {
length: 5,
method: function(y){
console.log(arguments.length)
}
}
@Akifcan
Akifcan / object-flat.js
Created April 23, 2022 21:18
Object flatten Example
const cv = {
age: 20,
name: 'akif',
title: 'web developer',
contact: {
number: '0535-232-22-17'
},
address: {
home: 'bornova',
scholl: {
@Akifcan
Akifcan / docker.compose.yml
Created March 30, 2022 17:25
my docker compose example
version: '3.7'
services:
postgres:
image: postgres:latest
restart: always
environment:
- POSTGRES_USER=campusUsername
- POSTGRES_PASSWORD=campusPassword
- POSTGRES_DB=campus_db