Skip to content

Instantly share code, notes, and snippets.

View babette-landmesser's full-sized avatar

Babette Landmesser babette-landmesser

View GitHub Profile
@babette-landmesser
babette-landmesser / webpack.config.js
Created December 27, 2020 14:37
my basic webpack config for typescript projects
const path = require('path');
const CopyWebpackPlugin = require('copy-webpack-plugin');
module.exports = {
entry: ['./src/main.ts', './src/scss/styles.scss' ],
output: {
filename: 'main.js',
path: path.resolve(__dirname, 'dist')
},
resolve: {
@babette-landmesser
babette-landmesser / line-chart.component.ts
Created November 16, 2020 06:56
The component file for line chart
import { Component, ElementRef, Input, OnChanges } from '@angular/core';
import * as d3 from 'd3';
@Component({
selector: 'app-line-chart',
templateUrl: './line-chart.component.html',
styleUrls: ['./line-chart.component.scss']
})
export class LineChartComponent implements OnChanges {
@Input() public data: { value: number, date: string }[];
[
{
"value": 20,
"date": "2020-05-12T12:19:00+00:00"
},
{
"value": 50,
"date": "2020-05-14T12:19:00+00:00"
},
{
@babette-landmesser
babette-landmesser / data.js
Created June 1, 2020 12:46
D3.js sitemap creation
export default {
data: [
{"name":"mediaman.com/"},
{"name":"mediaman.com/leistungen/digitale-beratung"},
{"name":"mediaman.com/leistungen/data-sprint"},
{"name":"mediaman.com/leistungen/data-ideation-workshop"},
{"name":"mediaman.com/agentur"},
{"name":"mediaman.com/jobs"},
{"name":"mediaman.com/datenschutzhinweise"},
{"name":"mediaman.com/impressum"},
@babette-landmesser
babette-landmesser / nodejs-crawler.js
Created May 31, 2020 09:52
A simple nodejs crawler to collect all internal links on a given domain
const cheerio = require('cheerio');
const request = require('request');
const fs = require('fs');
const crawledPages = [];
const crawledPagesData = [];
let foundPages = [];
let index = 0;
const domain = process.argv[2];
/**
* BLOCK: media-text-teaser
*
* Registering a basic block with Gutenberg.
* Simple block, renders and saves the same content without any interactivity.
*/
import React from 'react';
import { Toolbar } from '@wordpress/components';
// Import CSS.
import './editor.scss';
module.exports = {
"env": {
"browser": true,
"node": true
},
"extends": [
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended"
],
"globals": {},