Skip to content

Instantly share code, notes, and snippets.

@esakal
esakal / App.tsx
Last active May 10, 2022 13:16
Mediaspace theme support
import ReactDOM from "react-dom";
import React, {ComponentType, Suspense} from "react";
import { MediaSpaceThemeProvider } from "@mediaspace/ui/theme"; <--- TODO Tal replace all occurences of import { ThemeProvider } from "@kep-ui-kit/ui-theme";
// eslint-disable-next-line @nrwl/nx/enforce-module-boundaries
import { RegistrationSiteHeaderProps } from "@mediaspace/shared/registration-site-header";
import { Config, ConfigProvider } from "@mediaspace/shared/data-kms-config";
const RegistrationSiteHeader = React.lazy(() => import("@mediaspace/shared/registration-site-header"));
var contextMenus = {};
var context = "image";
var title = "Copy Actual Image";
contextMenus.copyImageNotUrl = chrome.contextMenus.create({"title": title,
"contexts":[context],
onclick: async (info, tab) => {
const imageSrc = info?.srcUrl;
console.log('got a request to download an image', { info})
@esakal
esakal / backendless-typescript-classes.md
Last active January 16, 2021 13:08
Backendless Typescript classes for defined data tables

About

Note This code is under development and is missing features that will be added later.

This is generator code creates Typescript based classes for defined data tables.

Backlog

  • One-To-One relations retrieving
  • One-To-Many relations retrieving
  • Generate Users interface (no need for class as any changes should be done in cloud code)
  • fix indentation
import buildUrl from 'build-url';
import moment from 'moment';
import { fetchGetWithinPage } from '../helpers/fetch';
import { BaseScraperWithBrowser, LOGIN_RESULT } from './base-scraper-with-browser';
import { waitForRedirect } from '../helpers/navigation';
import { waitUntilElementFound, elementPresentOnPage, clickButton } from '../helpers/elements-interactions';
import {
NORMAL_TXN_TYPE,
INSTALLMENTS_TXN_TYPE,
TRANSACTION_STATUS,
// NOTICE - this scraper is using date range to fetch transactions. It breaks the installments support of our scrapers
// since it doesn't return installments beside the first one.
// see https://gist.github.com/esakal/75a291267530fa7a7980577ae5dd055c
import buildUrl from 'build-url';
import moment from 'moment';
import { fetchGetWithinPage } from '../helpers/fetch';
import { BaseScraperWithBrowser, LOGIN_RESULT } from './base-scraper-with-browser';
import { waitForRedirect } from '../helpers/navigation';
import { waitUntilElementFound, elementPresentOnPage, clickButton } from '../helpers/elements-interactions';
@esakal
esakal / deep-clone
Created July 12, 2018 13:34
deep clone with customizer
function deepClone(source, customizer){
const _deepClone = function (source, customizer, sourcePath) {
// If the source isn't an Object or Array, throw an error.
if ( !(source instanceof Object) || source instanceof Date || source instanceof String) {
throw new Error('Only Objects or Arrays are supported.');
}
// Set the target data type before copying.
var target = source instanceof Array ? [] : {};
@esakal
esakal / setup-tasks.md
Last active March 27, 2018 05:32
Setup Tasks flow in israeli-ynab-updater library
  • Question: What do you want to do?
    • Option: Create a new task
      • Question:  What is the task name (leave blank to cancel)
        • Feedback: A task with this name already exists, please type a unique name
        • _Feedback: The task name must include only these characters: A-Z, 0-9, -, _ _
      • Feedback: Task named ${taskName}’ created
      • Feedback: Task creation cancelled
    • Option: Modify an existing task
      • Question:  Select a task to modify
  • Feedback: Entering task ‘${taskName}’ edit mode