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
@janpauldahlke
janpauldahlke / example_reduck.tsx
Created July 23, 2021 13:52
exmaple of reducks pattern in react
import { Action } from 'redux';
/* wouldnt it be smarter jsut top pass an argument with _error object*/
//enum
enum NotificationActions {
THROW_NOTIFICATION = 'THROW_NOTIFICATION',
THROW_NOTIFICATION_WITH_MESSAGE = 'THROW_NOTIFICATION_WITH_MESSAGE',
RESET_NOTIFICATION_STORE = 'RESET_NOTIFICATION_STORE',
}
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}>
//**