Skip to content

Instantly share code, notes, and snippets.

View JimiSweden's full-sized avatar

Jimi Friis JimiSweden

  • Live For Real
  • Stockholm Sweden
View GitHub Profile
@JimiSweden
JimiSweden / MaterialTableGettingHoldOfRenderData.js
Last active June 14, 2021 17:28
material-table example getting filtered data, the tables current view data, including 2 options and some other examples of actions/buttons, how to use SvgIcon from Material-UI
/**
* Example of using MaterialTable and getting hold of the filtered data rows in TWO different ways (useEffect, and MaterialTable.onSearchChange).
* filtered data is found in MaterialTable.state.data (and.renderData)
*
* Also some examples of how to render actions (buttons),
* conditional and 'standard'
* And a simple details pane when expanding the row.
* And how to use SvgIcon from @material-ui/icons fo raction buttons
*
@JimiSweden
JimiSweden / reactReadImageFromDatabaseArrayBufferToBase64
Created April 3, 2020 12:04
javscript / react read image from database buffer array convert to base64 using Window.btoa()
// full example : https://medium.com/@colinrlly/send-store-and-show-images-with-react-express-and-mongodb-592bc38a9ed
// index.js
import React, { Component } from 'react';
class Image extends Component {
constructor(props) {
super(props);
this.state = {
img: ''
};
@JimiSweden
JimiSweden / pattern_to_wrap_subcomponents_Test_react_components_depending_on_X_with_wrapper.js
Created April 8, 2020 16:37
Injecting context into mount using a wrapper function , testing react Browser dependent components, pattern for wrapping sub-components, enzyme, shallow
/*
You can also use this pattern to wrap subcomponents in other types of context,
for example if you are using react-intl, material-ui or your own context types.
from:
https://stackoverflow.com/questions/50025717/jest-enzyme-invariant-violation-you-should-not-use-route-or-withrouter-ou
by: https://stackoverflow.com/users/8070554/steve-banton
Wrapping mount with Router in tests works,
but there are situations where you don't want Router to be the parent component in your mount.
@JimiSweden
JimiSweden / EventStoreGettingStarted_windows10_troubleshooting.md
Last active November 26, 2021 19:24
Getting started with EventStore on Windows 10, problems and solutions

Getting started with EventStore on Windows 10

(2020-06-28)

A beginner stumbling on the first line... I really started to feel stupid 🙄 (if you want the "quick fix" try using https://127.0.0.1:2113/ - but please read about the configration problems I had as it might be good knowledge ot have if you stumble on the same errors)

Following https://eventstore.com/docs/getting-started/index.html for windows (and also docker with no success)

I had problems to understand why I could not connect to http://127.0.0.1:2113/ when following the guide. (I have now reported a documentation bug in EventStore/EventStore#2573)

@JimiSweden
JimiSweden / Aspose Email SmtpClient API missmatch net40 vs netstandard.md
Last active October 14, 2020 19:04
My adventures in Aspose.Email SmtpClient troubleshooting dotnetstandard vs net40- and other Aspose libraries (Total, Words, Cells, Pdf.. )

Brief background

The Aspose.Email library is used to build emails and send using SMTP.

  • reason for using Aspose at first is that the project have the Aspose.Total license, including Email, and uses other Aspose libraries for handling documents.

The Solution structure and implementation of Aspose.Email

  • "EmailProcessor" a dotnet standard 2.0 Library implementing Aspose.Email
  • "EmailProcessor.Test" a dotnet core 3.1 unit test project
  • "WindowsService" a .Net Framework (4.8) service project; Framework and not Core, because that is decided due to the environment. However, the Library (EmailProcessor) was supposed to be in dotnet standard.
@JimiSweden
JimiSweden / dwraw.io. configuration example.md
Last active January 22, 2024 02:15
draw.io windows app override default configuration to allow larger images

problem

When trying to insert an image you might get the warning "Image too big" when selecting "Actual size" in the insert dialog

Soulution

is to change the default settings.

note: this is tested on Windows, probably similar in Mac - check out the linke here if you are using Mac https://gist.github.com/cellularmitosis/e5e7d1517939b98418a58cdd8595dd8c

open Draw.io app ()

  • in menu "Extras" , select "Configuration".