Skip to content

Instantly share code, notes, and snippets.

View morten-olsen's full-sized avatar
🤖

Morten Olsen morten-olsen

🤖
View GitHub Profile
@morten-olsen
morten-olsen / self-signed-certificate-with-custom-ca.md
Created November 9, 2019 06:50 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@morten-olsen
morten-olsen / gist:62cde98fe6d86cdeb2de244f0d3b1d41
Created September 5, 2016 10:35 — forked from msmuenchen/gist:9318327
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
@morten-olsen
morten-olsen / react-proptype-warnings-as-errors-with-sinon.markdown
Created July 18, 2016 12:59 — forked from scmx/react-proptype-warnings-as-errors-with-sinon.markdown
Make React PropType warnings throw errors with mocha.js, enzyme.js and sinon.js

Make React PropType warnings throw errors with enzyme.js + sinon.js + mocha.js

A simple stateless functional component that we want to test that it renders without propType warnings.

import React, { PropTypes } from 'react'

let VersionListItem = function ({ active, version }) {
  return (
@morten-olsen
morten-olsen / JavaScriptSafeNavigation.md
Created February 17, 2016 16:07 — forked from d-akara/JavaScriptSafeNavigation.md
JavaScript Safe Navigation

Experimental Safe JavaScript Navigation

Implemented using ES6 Proxies and Symbols

Suggestions for improvements welcome!

const nonNavigableTarget = Symbol();

function safe(target, defaultValue) {