Skip to content

Instantly share code, notes, and snippets.

View juliankrispel's full-sized avatar

Julian Krispel juliankrispel

View GitHub Profile
@juliankrispel
juliankrispel / test.md
Last active June 11, 2024 15:25
test.md
  1. Two
  2. Two
    • Three
  3. Four
Hello
@juliankrispel
juliankrispel / anything
Last active April 9, 2021 09:16
turo test
MyOtherVariable = 39km
@juliankrispel
juliankrispel / lambda.webpack.config.js
Created September 28, 2020 09:32
Simple Webpack for compiling Typescript Lambda deployment packages
const path = require('path');
const { readdirSync } = require('fs');
const exec = require('child_process').execSync;
const dir = 'src'
const entry = readdirSync(dir)
.filter(item => /\.(t|j)s$/.test(item))
.filter(item => !/\.d\.(t|j)s$/.test(item))
.reduce((acc, fileName) => ({
...acc,
@juliankrispel
juliankrispel / aws-lambda-api-gateway.tf
Last active September 17, 2019 11:48
Terraform config for basic lambda and api gateway integration
provider "aws" {
region = "eu-west-1"
profile = "my-profile"
}
resource "aws_iam_role" "iam_for_lambda" {
name = "iam_for_lambda"
assume_role_policy = <<EOF
{
@juliankrispel
juliankrispel / gist:5dcd61a91f5d3072289022977f565faf
Created October 19, 2018 12:45
changing indent of selection
import { EditorState, Modifier } from 'draft-js';
import { TAB_CHARACTER } from './CONSTANTS';
const changeIndent = (editorState, isDedent) => {
const selection = editorState.getSelection();
const contentState = editorState.getCurrentContent();
let blockMap = contentState.getBlockMap();
const blockKeys = blockMap.keySeq();
const selectionStartKey = selection.getStartKey();
const selectionEndKey = selection.getEndKey();
@juliankrispel
juliankrispel / ClientRect.jsx
Created October 18, 2018 14:24
Simple Render Prop component to poll element measurements
import React, { PureComponent } from 'react'
/*
* PollBounds
* render with referenced element measurements
* @param measureRef: React.Ref
* @param pollTime: number - polling time for polling client rect
* @param children({ bounds })
*/
<RenderObservable
observable={interval(2000).pipe(startWith(0))}
>
{({ value, value$ }) => <div>
<Number>Value of {value}</Number>
<RenderObservable
observable={value$ && merge(value$, interval(300))}
>
{({ value }) => <Number>Value of {value}</Number>}
</RenderObservable>
@juliankrispel
juliankrispel / react-rxjs.js
Created June 19, 2018 00:23
Extremely basic way of rendering observables as components
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import { interval } from 'rxjs'
class RenderObservable extends Component {
state = {
value: null
}
@juliankrispel
juliankrispel / index.js
Created November 8, 2017 09:51
TSB Statement crawler
/* Configure these parameters to crawl for your statements */
const userId = '<your-user-id>';
const password = '<your-password>';
const secret = '<your-secret>';
const dateStringUntil = '<date>';
const Nightmare = require('nightmare');
const nightmare = Nightmare({ show: true });
const createCsvWriter = require('csv-writer').createObjectCsvWriter;
@juliankrispel
juliankrispel / djsp-mentions-example.jsx
Last active October 3, 2017 10:26
Pseudo-code Example for a mention plugin implementation with a new draft js plugins api.
import React, { Component } from 'react';
import { EditorState } from 'draft-js-plugins';
import Editor from 'djsp.editor';
import autocompletePlugin from 'djsp.autocomplete';
import selectionPositionPlugin from 'djsp.selection-position';
import entityDecoratorPlugin from 'djsp.entity-decorator';
import Popover from 'djsp.popover';
import ListBox from 'djsp.listbox';
import addEntity from 'djsp.add-entity';