Skip to content

Instantly share code, notes, and snippets.

@herrernst
herrernst / http-timeout.html
Last active September 14, 2018 16:25
http timeout
<!doctype html>
<p>hello</p>
<script src="https://1.2.3.4/"></script>
<p>finish</p>
<!doctype html>
<style>
[data-oembed] iframe {
display: block;
border: 0 none;
}
</style>
<h1>oembed example</h1>
<p>WTF most oembed endpoints don't support CORS, so have to fetch from server; there are services: https://github.com/itteco/oembed-api</p>
<div data-oembed="https://www.youtube.com/oembed?url=http%3A//youtube.com/watch%3Fv%3DM3r2XDceM6A&format=json"></div>
@herrernst
herrernst / asound.conf
Created March 4, 2018 07:47
alsa dmix raspberry pi hifiberry
pcm.hifiberry {
type hw card 0
}
pcm.!default {
type plug
slave.pcm "dmixer"
}
pcm.dmixer {
<!doctype html>
<body>
<blockquote class="twitter-tweet" data-lang="de"><p lang="en" dir="ltr">Mm just saw the new Snapchat.. I don’t know how i feel about it! What do you guys think?</p>&mdash; Kylie Jenner (@KylieJenner) <a href="https://twitter.com/KylieJenner/status/962048891485999105?ref_src=twsrc%5Etfw">9. Februar 2018</a></blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
</body>
@herrernst
herrernst / touchmove-prevent.html
Created September 6, 2017 12:15
safari touchmove event preventDefault
<!doctype html>
<meta name="viewport" content="initial-scale=1">
<h1>safari touchmove event preventDefault</h1>
<div style="width: 300px; height: 300px; background: green"></div>
<h2>works</h2>
<pre>
document.addEventListener("touchmove", (e) => e.preventDefault())
</pre>
<h2>works</h2>
<pre>
@herrernst
herrernst / web-embed.html
Last active August 29, 2017 14:50
Web embeds
<!doctype html>
<title>Web embeds</title>
<h2>Youtube</h2>
<iframe width="560" height="315" src="https://www.youtube.com/embed/dQw4w9WgXcQ" frameborder="0" allowfullscreen></iframe>
<h2>Twitter</h2>
<blockquote class="twitter-tweet" data-cards="hidden" data-lang="en"><p lang="en" dir="ltr">&quot;No one is born hating another person because of the color of his skin or his background or his religion...&quot; <a href="https://t.co/InZ58zkoAm">pic.twitter.com/InZ58zkoAm</a></p>&mdash; Barack Obama (@BarackObama) <a href="https://twitter.com/BarackObama/status/896523232098078720">August 13, 2017</a></blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>
@herrernst
herrernst / browser-standby.md
Last active February 3, 2017 05:36
Browser behavior on computer standby

Windows 10, Ethernet DHCP

IE11

offline/online events: yes

expired timers: fire immediately

active timers: fire on time

Firefox 50

@herrernst
herrernst / Dockerfile
Last active December 20, 2016 22:54
Dockerfile to build librespot on Ubuntu Trusty
FROM ubuntu:trusty
RUN dpkg --add-architecture armhf
RUN sed -i 's/deb /deb [arch=amd64,i386] /g' /etc/apt/sources.list
RUN sed -i 's/deb-src /#deb-src /g' /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty-security main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ trusty-updates main" >> /etc/apt/sources.list
RUN apt-get -y update
RUN apt-get install -y gcc-arm-linux-gnueabihf libasound2:armhf libasound2-dev:armhf
RUN apt-get install -y gcc g++ git curl pkg-config libprotoc-dev file
@herrernst
herrernst / Dockerfile
Created December 20, 2016 22:19
Dockerfile to build librespot on Ubuntu Precise
FROM ubuntu:precise
RUN echo -n "foreign-architecture armhf" > /etc/dpkg/dpkg.cfg.d/multiarch
RUN sed -i 's/deb /deb [arch=amd64,i386] /g' /etc/apt/sources.list
RUN sed -i 's/deb-src /#deb-src /g' /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise-security main" >> /etc/apt/sources.list
RUN echo "deb [arch=armhf] http://ports.ubuntu.com/ precise-updates main" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get install -y gcc-arm-linux-gnueabihf libasound2:armhf libasound2-dev:armhf portaudio19-dev:armhf
RUN apt-get install -y gcc g++ git curl pkg-config libprotoc-dev file make
<!doctype html>
<title>gradient gray alpha</title>
<meta name="viewport" content="width=device-width">
<style>
.gradient {
width: 768px;
height: 300px;
background-image: linear-gradient(to right, rgba(0, 0, 0, 0.5), rgb(128, 128, 128));
}
</style>