Skip to content

Instantly share code, notes, and snippets.

@asfktz
asfktz / how to make desktop version of google docs.md
Last active January 20, 2023 00:18
google docs - desktop version

steps:

  • you need to have node.js installed

  • copy main.js & package.json to a new folder

  • in the terminal:

    • to build it, run: npm install and then npm start

    • to pack it like a regular app, use 'electron-packager'. install it globally by running: npm install electron-packager -g

Aaa
Init -> Assignment has challenge?
Assignment has challenge?
yes -> Challenge
no -> Single Package
Challenge
start package -> Work
Work
@asfktz
asfktz / Tabs.jsx
Last active November 23, 2019 11:19
Context Based Tabs
import React, { Children, cloneElement, useState, createContext, useContext } from 'react';
const ctx = createContext();
export function Tabs ({ children }) {
const [selectedIndex, selectIndex] = useState(0);
return (
<ctx.Provider value={{ selectedIndex, selectIndex }}>
{children}
import './style.css';
import React, { useState } from 'react';
import Spinner from 'react-md-spinner';
import useInterval from '../../utils/useInterval';
import { random } from 'lodash';
const labels = [
'מכוונים את הגיטרות',
'פורשים מחצלות',
const MyWrapperMiddleware = store => next => action => {
const state = store.getState()
if (!state.isLoggedIn)
return next(action)
const pouchMiddleware = PouchMiddleware({
path: state.currentPath,
db,
let pouchMiddleware
let invalidate = true;
const MyWrapperMiddleware = store => next => action => {
const state = store.getState()
if (!state.isLoggedIn)
return next(action)
if (someConditionForChange) {
@asfktz
asfktz / UserForm.jsx
Last active February 10, 2017 23:11
react-redux-form nested reducer issue
import React from 'react';
import { Control, Form } from 'react-redux-form';
class UserForm extends React.Component {
render() {
return (
<Form model="forms.user"
onSubmit={(user) =>
console.log('-->', user)
}>
class Button extends React.Component {
handleClick = (e) => {
console.log(this)
}
render () {
return (
<div onClick={this.handleClick}>
Click
</div>
class Button extends React.Component {
constructor (props) {
super(props)
this.handleClick = this.handleClick.bind(this)
}
handleClick () {
console.log(this)
}
class Button extends React.Component {
handleClick () {
console.log(this)
}
render () {
return (
<div onClick={::this.handleClick}>
Click
</div>