A Pen by Patrick Favre-Bulle on CodePen.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Copyright 2017 Patrick Favre-Bulle | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2017 Patrick Favre-Bulle | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Binary | |
┌─────────────────┬──────────────────────────────────────────────────────────────────┐ | |
│ Efficiency │ 12.5 % (1 bit/char), 1 bit segments │ | |
│ 32/64/128 bit │ 1-32/1-64/1-128 chars │ | |
│ Padding │ false │ | |
│ Const. Out. Len.│ false │ | |
│ Suited for │ number encoding, debugging │ | |
│ Alphabet │ 01 │ | |
│ Known Usages │ none │ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Random Data | |
Original size: 1024 byte | |
Compressed size (raw): 1047 byte | |
Name enc diff % enc-comp diff | |
------------------------------------------------------------------ | |
base85 1280 256 23% 1076 29 2% | |
base64 1366 342 31% 1073 26 2% | |
base36 1585 561 51% 1082 35 3% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{/* If you are using a CSP header this is how you can whitelist the inline-script */}} | |
{{/* its not optimal since it only changes every day and only if you regenerate the site */}} | |
{{ $currentDayNonce := now | time.Format "2006-01-02" | md5 }} | |
<meta http-equiv="Content-Security-Policy" | |
content="default-src 'self'; | |
script-src 'self' 'nonce-{{ $currentDayNonce }}'; | |
img-src 'self';" | |
/> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export const figureCaption = function (service: TurndownService): void { | |
service.addRule('stackOverflowHighlightedCodeBlock', { | |
filter: function (node: HTMLElement, options: Options): boolean | null { | |
const firstChild = node.firstChild | |
const lastChild = node.lastChild | |
return ( | |
node.nodeName === 'FIGURE' && | |
firstChild && firstChild.nodeName === 'IMG' && | |
lastChild && lastChild.nodeName === 'FIGCAPTION' | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# This is part of my blog about AES: https://medium.com/p/7616beaaade9 | |
# Inspired by https://blog.filippo.io/the-ecb-penguin/ | |
# Convert your image to .ppm with Gimp or Photoshop | |
# | |
# Usage: ./ecb_img <image file as ppm> <password> | |
# extract header and body |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2017 Patrick Favre-Bulle | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |