Skip to content

Instantly share code, notes, and snippets.

View janpauldahlke's full-sized avatar
🏠
Working from home

HagbardCeline janpauldahlke

🏠
Working from home
  • Germany
View GitHub Profile
save(close?: boolean): void {
this.resourceService
.save(this.formName, this.id, this.workItemForm.value)
.pipe(
tap(res => {
if (close) {
// Sofort Schließen, Rest interessiert uns nicht
this.savedAndClosing.emit({ wi_resourceType: 'researchStudy', wi_id: this.id } as IWorkItem);
return;
}
onFileSelected(event: Event): void {
const file: File = (<HTMLInputElement>event.target).files[0];
this.fileName = file.name;
const { type } = file;
if (type === 'image/png' || type === 'image/jpg' || type === 'image/jpeg') {
// this is standart browser api
const formData = new FormData();
formData.append('thumbnail', file);
import React from "react"
import { Location } from "@reach/router"
import styled, { ThemeProvider } from "styled-components"
import Favicon from '../../assets/DentaMile.ico';
import Helmet from 'react-helmet';
import Header from "../components/header"
import SideBar from "../components/sidebar"
import Footer from "../components/footer"
import React, { useEffect } from "react"
import { StaticQuery, graphql } from "gatsby"
import Img from "gatsby-image"
import { connect } from "react-redux"
import { toggleLightBox } from "../state/app"
import { isFunction } from "lodash"
/* props : {
src : String!
description: String!,
const fs = require('fs');
const path = require('path');
const dirPath = path.join(__dirname + '/data/')
//helpers
//reads all json files
const readFiles = (dir) => {
const returnFiles = [];
@janpauldahlke
janpauldahlke / index.html
Created April 24, 2019 13:16
nettrekt player
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>4.5.1. mit Empfehlung</title>
<style>
@janpauldahlke
janpauldahlke / snippet_collectio.js
Created March 26, 2019 14:14
a brief collection of my snippets, i should look here BEFORE googling around
//-----------------
//random a hex color
//-----------------
const randomColor = () => {
return '#'+Math.floor(Math.random()*16777215).toString(16);
};
//-----------------
//observes a change in an object via proxy
//-----------------
@janpauldahlke
janpauldahlke / README.md
Created March 13, 2019 19:06 — forked from roachhd/README.md
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

if (!this.state.isReverse) {
return (
<TableBody>
{
_sortBy(this.props.OfficerGroups, [this.state.sorted])
.map((group: OfficerGroup, groupIndex: number) => {
return (
<TableRow key={groupIndex}>
//**
@janpauldahlke
janpauldahlke / example.tsx
Created November 16, 2018 10:31
problems with APIs without any respsonse data
//thunk action
public static updateFieldToSpecial(fromId: number, value: number, removeFlag? : boolean) {
let index : number = -1;
const route : string = !removeFlag ? process.env.REACT_APP_SENDERCONFIG ? `${process.env.REACT_APP_SENDERCONFIG}/${fromId}` : '' : process.env.REACT_APP_SENDERCONFIG ? `${process.env.REACT_APP_SENDERCONFIG}/remove/${fromId}` : '';
const field : string = 'tospecial';
return function (dispatch: any, getState : () => RootState) {
const stateSender = getState().SenderConfigStore.SenderConfig;
if(stateSender && Array.isArray(stateSender) && stateSender.length > 0) {