Skip to content

Instantly share code, notes, and snippets.

Avatar

Elad Cohen eladcandroid

  • Web & Android Full Stack Developer
  • Israel
View GitHub Profile
@eladcandroid
eladcandroid / products.ts
Created Oct 19, 2020
Angular Tutorial products.ts
View products.ts
export const products = [
{
name: 'Phone XL',
price: 799,
description: 'A large phone with one of the best screens'
},
{
name: 'Phone Mini',
price: 699,
description: 'A great phone with one of the best cameras'
@eladcandroid
eladcandroid / styles.scss
Created Oct 19, 2020
Angular Tutorial styles.scss
View styles.scss
/* Global Styles */
* {
font-family: "Roboto", Arial, sans-serif;
color: #616161;
box-sizing: border-box;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
@eladcandroid
eladcandroid / vanillaReduxFinal.html
Last active Apr 16, 2020 — forked from Arieg419/vanillaReduxFinal.html
Refactor to arrow functions
View vanillaReduxFinal.html
<!DOCTYPE html>
<html>
<head>
<title>GoCode</title>
<script src="https://unpkg.com/redux@latest/dist/redux.min.js"></script>
</head>
<body>
<div>
<p>
Counter: <span id="value">0</span> times
@eladcandroid
eladcandroid / Default.vue
Last active Feb 24, 2020
Gridsome Workshop - Part 2
View Default.vue
<template>
<div class="layout bg-gray-200 font-sans leading-normal tracking-normal">
<div
class="w-full m-0 p-0 bg-cover bg-bottom"
style="background-image:url('/cover.jpg'); height: 40vh; max-height:260px;"
>
<div
class="container max-w-4xl mx-auto pt-16 md:pt-15 text-center break-normal"
>
<!--Title-->
@eladcandroid
eladcandroid / Default.vue
Last active Feb 24, 2020
Gridsome Workshop - Part 1
View Default.vue
<template>
<div class="layout bg-gray-200 font-sans leading-normal tracking-normal">
<div
class="w-full m-0 p-0 bg-cover bg-bottom"
style="background-image:url('/cover.jpg'); height: 40vh; max-height:260px;"
>
<div
class="container max-w-4xl mx-auto pt-16 md:pt-15 text-center break-normal"
>
<!--Title-->
@eladcandroid
eladcandroid / Counter.vue
Created Aug 2, 2019
Vue 3 Function API Basic Example
View Counter.vue
<template>
<div>
<span>count is {{ count }}</span>
<span>plusOne is {{ plusOne }}</span>
<button @click="increment">count++</button>
</div>
</template>
<script>
import { value, computed, watch, onMounted } from 'vue'
View decomposedSetupComponent.vue
// ...
<script>
import {
ref,
watch,
computed,
onMounted,
onUnmounted
} from '@vue/composition-api'
import { fetchUserPosts } from '@/api'
View scrollFetchSetupComponent.vue
// ...
<script>
import {
value,
watch,
computed,
onMounted,
onUnmounted
} from 'vue-function-api'
import { fetchUserPosts } from '@/api'
@eladcandroid
eladcandroid / scrollSetupComponent.vue
Last active Mar 30, 2020 — forked from enkot/scrollSetupComponent.vue
Change to Vue Composition Api
View scrollSetupComponent.vue
// ...
<script>
import { ref, onMounted, onUnmounted } from '@vue/composition-api'
export default {
setup(props) {
const pageOffset = ref(0)
const update = () => {
pageOffset.value = window.pageYOffset
}
@eladcandroid
eladcandroid / PostsPage.vue
Created Aug 2, 2019
Vue 3 Function API - HOC
View PostsPage.vue
<template>
<div id="app">
<PostsPage :id="currentUser" />
</div>
</template>
<script>
import { fetchUserPosts } from '@/api'
import PostsPage from '@/components/PostsPage'
const withPostsHOC = (WrappedComponent) => ({