Skip to content

Instantly share code, notes, and snippets.

View edisdev's full-sized avatar
📺

Hatice Edis edisdev

📺
View GitHub Profile
@edisdev
edisdev / date.js
Last active May 11, 2021 10:37
Ay ve Günlerin Javascript İle Dil Ayarı İçin Ufak Bir Yöntem
function calendarTranslation(lang) {
const currentYear = new Date().getFullYear()
const months = Array.from({length: 12}, function(_, index) {
let name = new Date(currentYear, index).toLocaleString(lang, { month: 'long' })
return ({index, name })
})
const days = Array.from({length: 7}, function (_, index) {
let name = new Date(currentYear, '00', index).toLocaleString(lang, { weekday: 'long' })
@edisdev
edisdev / amplify-example.js
Created February 21, 2021 02:37
Amplify example with React
import Head from 'next/head'
import { API } from 'aws-amplify'
import styles from '../styles/Home.module.css'
import { listTodos } from '../graphql/queries'
import { useEffect, useState } from 'react'
export default function Home() {
let [todoList, setTodoList] = useState([])
@edisdev
edisdev / vue3-example.vue
Last active April 11, 2023 13:34
Vue 3 Example With Composition API and Custom CSS Variable
<template>
<div class="Example">
<h1>JS IN CSS Reactive Example</h1>
<div class="area">
<div class="form">
<label>Select Color</label>
<input type="color" v-model="customTheme.bgColor" />
</div>
<div class="preview">
<span>{{ customTheme.bgColor }}</span>
@edisdev
edisdev / form.js
Created January 25, 2022 21:22
Amplify contact form
import Head from 'next/head'
import { API } from 'aws-amplify'
import { useState } from 'react'
import { createContact } from '../src/graphql/mutations'
import styles from '../styles/Home.module.css'
export default function Home() {
@edisdev
edisdev / lambda.js
Created January 26, 2022 00:31
Lambda Function For SES
const aws = require('aws-sdk')
const ses = new aws.SES()
exports.handler = async (event) => {
for (const record of event.Records) {
if (record.eventName === 'INSERT') {
const newData = record.dynamodb.NewImage
const name = newData.name.S
@edisdev
edisdev / product.js
Created June 28, 2022 20:35
Pinia Store Example
import { defineStore } from 'pinia'
export const useProductStore = defineStore('product', {
state: () => ({
products: [],
isFetchingProducts: false
}),
getters: {
categories () {
const categoryList = this.products
@edisdev
edisdev / Products.vue
Created June 28, 2022 22:06
Pinia example vue file
<template>
<h1 class="ProductTitle">Ürünler</h1>
<template v-if="isFetchingProducts">
<div class="ProductLoader">
<Loader/>
</div>
</template>
<div v-else class="categories">
<Category
v-for="(category, categoryName) in categories"