Skip to content

Instantly share code, notes, and snippets.

View eladcandroid's full-sized avatar

Elad Cohen eladcandroid

  • Web & Android Full Stack Developer
  • Israel
View GitHub Profile
@eladcandroid
eladcandroid / vanillaReduxFinal.html
Last active April 16, 2020 10:54 — forked from Arieg419/vanillaReduxFinal.html
Refactor to arrow functions
<!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 / 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 / formProgress.js
Created January 22, 2019 14:30 — forked from adactio/formProgress.js
Show a progress bar with every form that has a method of POST. Particularly nice if there's a file upload involved.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
(function (win, doc) {
'use strict';
if (!win.XMLHttpRequest || !win.FormData || !win.addEventListener || !doc.querySelectorAll) {
// doesn't cut the mustard.
return;
}
function hijaxForm (formElement) {
var progressBar;
@eladcandroid
eladcandroid / 0_reuse_code.js
Created March 7, 2017 13:37
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console