Skip to content

Instantly share code, notes, and snippets.

@herrernst
herrernst / grayramp.html
Last active October 6, 2016 19:29
draw grayscale ramp with html/css
<!doctype html>
<title>draw grayscale ramp</title>
<meta name="viewport" content="width=device-width">
<style>
.ramp {
height: 300px;
position: relative;
}
.ramp > div {
position: absolute;
@herrernst
herrernst / .fonts.conf
Created July 25, 2016 09:20 — forked from anonymous/.fonts.conf
Reduce hinting amount for fonts on linux
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM '/etc/fonts/fonts.dtd'>
<fontconfig>
<match target="font">
<edit name="hintstyle" mode="assign">
<const>hintslight</const>
</edit>
</match>
</fontconfig>
@herrernst
herrernst / js-find.js
Created December 18, 2013 15:47
javascript find in array with .reduce
//quick and dirty, does not consider all function params and this yet
Array.prototype.find = function (predicate) {
return this.reduce(function(prev, cur){return predicate(cur) ? cur : prev })
}
@herrernst
herrernst / retina.html
Created September 9, 2011 11:45
Retina Images with CSS content
<!doctype html>
<title>Retina Images with CSS content</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<style>
@media all and (-webkit-device-pixel-ratio: 1.5) {
/* e. g. android hi res devices
see: http://developer.android.com/guide/webapps/targeting.html#DensityCSS
*/
#people9 { content: url(//lorempixum.com/300/225/people/9/); }