Skip to content

Instantly share code, notes, and snippets.

View moqmar's full-sized avatar

Moritz Marquardt moqmar

View GitHub Profile
@media print {
#st-container, #prk_responsive_menu, #unten { display: none; }
#prk_ajax_container { margin-left: 0; }
#sidebar { display: none; }
#centered_block { max-width: 100%; }
.twelve.columns.sidebarized { padding: 0; }
/* Steht sonst in der linken Seitenleiste: */
body:after { content: "Wortwuchs.net"; display: block; text-align: right; font-size: 10pt; color: #888; margin-right: 25px; }
}
@moqmar
moqmar / _coverr.html
Last active January 19, 2021 18:52
Pure CSS implementation of coverr.co
<header class="coverr"><!-- The box you want the video as a background for: just add the "coverr" class -->
<div class="coverr-video">
<img src="[JPEG URL]" alt="">
<video autoplay loop>
<source src="[MP4 URL]" type="video/mp4">
<source src="[WEBM URL]" type="video/webm">
<!-- Non-HTML5 browsers will just show the image, no need for a fallback text -->
</video>
</div>
<!-- The box content -->
@moqmar
moqmar / fancyindex.css
Last active June 14, 2022 03:29
Minimal nginx Fancyindex Theme
/*
A modern look for the nginx fancyindex module (https://github.com/aperezdc/ngx-fancyindex)
[[ SCREENSHOT ]]
https://static.mo-mar.de/fancyindex-screenshot.jpg
[[ USAGE ]]
fancyindex on;
fancyindex_exact_size off;
fancyindex_css_href https://cdn.rawgit.com/moqmar/6c45c469cc7e8294f6cf1bcef9802331/raw/fancyindex.css;
@moqmar
moqmar / ses.js
Last active November 2, 2016 13:33
Simple Element Selection for JavaScript w/o jQuery
// Element Selection - _("#howcoolisthat") - https://gist.github.com/moqmar/55587fad606176fafbcf7777655f2fbe
// document.querySelector
window._ = document.querySelector.bind(document)
// document.querySelectorAll with callback
window.__ = function (selector, callback, element) {
var elements = Array.prototype.slice.call((element||document).querySelectorAll(selector));
if (typeof callback == "function")
for (var i = 0; i < elements.length; i++)
@moqmar
moqmar / parent.js
Last active February 13, 2017 16:44
// Parent Elements - e.P("body") - https://gist.github.com/moqmar/0995cf6595201f7a062fb173cb4ab938
(function(E){E.matches||(E.matches=E.matchesSelector||E.msMatchesSelector||E.webkitMatchesSelector)})(Element.prototype)
Element.prototype.P = function(s) {
var e = this;
if (!s || typeof s == "number") for (var i = 0; i < (s || 1); i++) e = e ? e.parentElement : e;
else if (typeof s == "string") while (e && !e.matches(s)) e = e.parentElement;
else while (e && e != s) e = e.parentElement;
return e
}
@moqmar
moqmar / leftpad.js
Last active February 13, 2017 16:36
Leftpad, as it has to be: simple, fast, flexible
// Leftpad - P(value, length, character, rightpad) - https://gist.github.com/moqmar/9ef4f0755d0a17b61458f35b91447bc1
function P(v,l,c,r) { v = v.toString(); while (v.length < l) v = r ? v + (c||0) : (c||0) + v; return v; }
// Usage: P(value, length, character, rightpad)
// P(25, 3) ➜ "025"
// P(1, 3, " ") ➜ " 1"
// P(25, 4, ".", true) ➜ "25.."
// public domain / cc0
@moqmar
moqmar / README.md
Last active February 11, 2018 21:47
Simplified Git Status for use in zsh prompts with fonts including FontAwesome.

Simplified Git Status for use in zsh prompts with fonts including FontAwesome.

 master

@moqmar
moqmar / keybase.md
Last active January 16, 2017 20:26

Keybase proof

I hereby claim:

  • I am moqmar on github.
  • I am momar (https://keybase.io/momar) on keybase.
  • I have a public key whose fingerprint is 8D0D F6B3 C0E7 963C 4DD8 3FFD 57C5 EC5D A3B7 595E

To claim this, I am signing this object:

@moqmar
moqmar / playground.html
Last active August 5, 2016 21:47
Shared via plgrnd.com
<!doctype html>
<meta charset="utf-8">
<style>
@import 'https://cdnjs.cloudflare.com/ajax/libs/normalize/4.2.0/normalize.min.css';
@import 'https://fonts.googleapis.com/css?family=Fira+Sans';
body { margin: 0; padding: 25px; background: #f8f8f8; font-family: Fira Sans, sans-serif; }
/* ... */
</style>
@moqmar
moqmar / base.css
Last active January 23, 2017 15:03
base.css - Simple but beautiful styling for all basic HTML elements in ~5KB. Useful as a basic stylesheet to build upon.
/*
BASE.CSS
‾‾‾‾‾‾‾‾
Simple but beautiful styling for all basic HTML elements. Useful as a basic stylesheet to build upon.
Version 0.4
Created by Moritz Marquardt, mo-mar.de
Licensed under CC0 - https://creativecommons.org/publicdomain/zero/1.0/
Provided classes: