Skip to content

Instantly share code, notes, and snippets.

@pke
pke / keybase.md
Created September 24, 2019 19:29

Keybase proof

I hereby claim:

  • I am pke on github.
  • I am pkursawe (https://keybase.io/pkursawe) on keybase.
  • I have a public key whose fingerprint is 03D2 C735 8C0E EDA4 76EF 97A9 923E 6361 D8D6 F83D

To claim this, I am signing this object:

@pke
pke / flatten.spec.js
Created March 27, 2019 07:26
Flatten an array
const tap = require("tap")
/**
* This function takes an array of items and flattens them.
* It can also handle multiply arguments.
*
* @param {array} items that can contain nested array items
* @return {array} flat array of input items or an empty array
*/
function flatten(items = []) {
@pke
pke / flatten.js
Created January 25, 2019 10:20
Flatten array items
const tap = require("tap")
/**
* This function takes an array of items and flattens them.
* It can also handle multiply arguments.
*
* @param {array} items that can contain nested array items
* @return {array} flat array of input items or an empty array
*/
function flatten(items = []) {
@pke
pke / config.js
Created April 12, 2018 19:09
Landing Page Sample
{
header: {
left: {
image: "https://assets.evopark.de/assets/flat_application/evopark_logo-068da0d2b9ceda29f17dd5a2744a23c812dbcd76bc5ecf6247cc81ca6e4592f1.svg",
},
middle: {
},
right: {
image: "https://assets.evopark.de/assets/flat_application/goldbeck_logo-e17f26ead18b0a202b47d69b5d8ca110dca5fed9f675669b4495b607413017ce.png",
},
@pke
pke / gist:496e3d30872f1eac36718c4b3420a7c6
Last active April 21, 2018 22:56
Your Email validation sucks
https://service.beoplay.com/
ersatzteile-info.de
https://www.dhl.de/popweb/gw2/nepal/ProductOrder.action
https://meine.norisbank.de
https://www.hotelbb.de
@pke
pke / gist:292cc4c3ecd548fbc1d9c8b485009629
Created January 26, 2018 14:33
Everything wrong with medium
You cant select text in comments below an article. Trying to do so will open the comment in a new page in the same tab.
Navigating back from a comment page to the original article loses the scroll position of the comment you initially clicked
Each navigate back to an article changes the 3 "related" articles below the article.
Recommended articles should actually be on the side of the article, comments right below the article.
@pke
pke / user.js
Last active November 2, 2016 22:22
GM Script for CTRL+SEND
// ==UserScript==
// @name CTRL+SEND
// @namespace http://tampermonkey.net/
// @version 1.0
// @description try to take over the world!
// @author pke
// @match http*://*/*
// @exclude https://twitter.com/*
// @exclude https://mail.google.com/*
// @grant none
const store = configureStore()
if (window.cordova) {
const onDeviceReady = () => {
store.dispatch(deviceReady())
}
document.addEventListener("deviceready", onDeviceReady, false)
}
ReactDOM.render(
@pke
pke / reducer
Created October 29, 2016 23:36
import { createStore, applyMiddleware } from "redux"
import createSagaMiddleware from 'redux-saga'
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly'
import logger from 'redux-logger'
import reducer from './reducers'
import saga from './sagas'
export default function configureStore(initialState) {
const sagaMiddleware = createSagaMiddleware()
const store = createStore(
@pke
pke / Distance.js
Created February 3, 2016 21:54
Geo-Location tracking react component using Higher-Order-Function for location updates
import React from "react"
import LocationType from "../types/LocationType"
/* Usage: <Distance to={{longitude,latitude}}/>
Renders the distance in m/km to the given location.
If `from` is omitted then the current geo-location is used and tracked.
*/
const propTypes = {
to: LocationType.isRequired,
from: LocationType.isRequired