Skip to content

Instantly share code, notes, and snippets.

View klippx's full-sized avatar

Mathias Klippinge klippx

View GitHub Profile
@klippx
klippx / .json
Created December 19, 2017 13:29
Issue with v0.5.1 of Ruby Kafka (incorrect offsets and eventual crash)
/** Receiving 1 message
# lag = 0
# fetched from offset = 772029
# first message offset = 772029
# last message offset = 772029
# highwater_mark_offset = 772030
# committed offset = 772030
*/
{"line":{"timestamp":"2017-12-19T00:21:45.780414Z","level":"DEBUG","logger":"RubyKafka","message":"Fetching batch from eu-live.kred.account-events/7 starting at offset 772029"}}
{"line":{"timestamp":"2017-12-19T00:21:55.296350Z","level":"INFO","logger":"Phobos","message":{"message":"Received batch on eu-live.kred.account-events/7","group_id":"account-overview-consumer-production-eu-kred.account-events_1","topic":"eu-live.kred.account-events","partition":7,"first_offset":772029,"last_offset":772029,"offset_lag":0,"highwater_mark_offset":772030,"message_count":1,"client_id":"phobos"}}}

How to migrate from dashlane to 1password

One does not simply export passwords from dashlane and expect them to be imported into 1password.

But with some DIY attitude it can be done:

  1. Export the Dashlane vault as CSV into a file, e.g. DashlanePrivate.csv
  2. Remove all non-password entries (cards, identities, passports, etc.).
  3. Create the migration script:
@klippx
klippx / useWindowSize.native.js
Last active November 12, 2019 13:51
useWindowSize [native]
import { useState, useEffect } from 'react'
import { Dimensions } from 'react-native'
const useWindowSize = () => {
const { width, height } = Dimensions.get('window')
const [state, setState] = useState({ width, height })
useEffect(() => {
const handler = result => {
setState({
@klippx
klippx / useWindowSize.web.js
Created November 12, 2019 13:51
useWindowSize [web]
import { useEffect, useState } from 'react'
const useWindowSize = () => {
const { innerWidth: width, innerHeight: height } = window
const [state, setState] = useState({ width, height })
useEffect(() => {
const handler = () => {
setState({
width: window.innerWidth,
it('can create a mock with specific body where order of keys does not matter', async () => {
const mock = mockClient(client)
.resource('Blog')
.method('post')
.status(204)
.with({
body: JSON.stringify({
title: 'title',
data: {
nestedItemOne: 1,