Skip to content

Instantly share code, notes, and snippets.

View eladcandroid's full-sized avatar

Elad Cohen eladcandroid

  • LLM + MCP = ❤️ | GoCode Founder
  • Israel
View GitHub Profile
@eladcandroid
eladcandroid / Default.vue
Last active February 24, 2020 11:38
Gridsome Workshop - Part 1
<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 August 2, 2019 10:29
Vue 3 Function API Basic Example
<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'
@eladcandroid
eladcandroid / decomposedSetupComponent.vue
Last active September 4, 2019 10:03 — forked from enkot/decomposedSetupComponent.vue
Change to Vue Composition Api
// ...
<script>
import {
ref,
watch,
computed,
onMounted,
onUnmounted
} from '@vue/composition-api'
import { fetchUserPosts } from '@/api'
// ...
<script>
import {
value,
watch,
computed,
onMounted,
onUnmounted
} from 'vue-function-api'
import { fetchUserPosts } from '@/api'
@eladcandroid
eladcandroid / scrollSetupComponent.vue
Last active March 30, 2020 02:11 — forked from enkot/scrollSetupComponent.vue
Change to Vue Composition Api
// ...
<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 August 2, 2019 10:13
Vue 3 Function API - HOC
<template>
<div id="app">
<PostsPage :id="currentUser" />
</div>
</template>
<script>
import { fetchUserPosts } from '@/api'
import PostsPage from '@/components/PostsPage'
const withPostsHOC = (WrappedComponent) => ({
@eladcandroid
eladcandroid / PostsPage.vue
Created August 2, 2019 10:03
Vue 3 Function API - Mixin
<template>
<div class="container">
<p v-if="isLoading" class="loading">Posts loading...</p>
<template v-else>
<div class="topbar" :class="{ open: pageOffset > 120 }">
<div class="container content">
<h3>User #{{ id }} posts</h3>
<span class="count">{{ count }} items</span>
</div>
</div>
@eladcandroid
eladcandroid / PostsPage.vue
Created August 2, 2019 09:59
Vue.js 3 Function API Example
<template>
<div class="container">
<p v-if="isLoading" class="loading">Posts loading...</p>
<template v-else>
<div class="topbar" :class="{ open: pageOffset > 120 }">
<div class="container content">
<h3>User #{{ id }} posts</h3>
<span class="count">{{ count }} items</span>
</div>
</div>
@eladcandroid
eladcandroid / README.md
Created June 30, 2019 12:33
Ionic Capacitor Instructions

Build For Android Instructions

During development

After git pull:

npm install
npx cap sync
ionic capacitor run android -l

On Android Studio:

@eladcandroid
eladcandroid / index.html
Last active July 8, 2019 13:25
Vue.js live exercise - Products with cart including Vue-Router
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>My App</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="lib/vue.js"></script>
<script src="lib/vue-router.js"></script>
</head>