Skip to content

Instantly share code, notes, and snippets.

@olafdietsche
olafdietsche / gist:a366bf8f0ec62b7caa0e3f99a5764030
Last active February 16, 2023 22:58 — forked from whosaysni/gist:5733660
Hello world with Xlib.
/*
hellox -- Hello world with Xlib.
$(CC) -o hellox hellox.c -lX11 -L/usr/X11/lib
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@olafdietsche
olafdietsche / fiddle.css
Created September 12, 2014 21:26
CSS: rotate an image on hover
img:hover {
transform: rotateY(180deg);
transition: all 1s ease 0s;
}
img {
transition: all 1s ease 0s;
}
@olafdietsche
olafdietsche / fiddle.css
Last active August 29, 2015 14:02
HTML and CSS only license badge, see [Badge-Poser](https://github.com/PUGX/badge-poser)
.badge {
font-family: DejaVu Sans, Verdana, Geneva, sans-serif;
font-size: 11px;
color: white;
}
.badge.tag {
background-color: #4c4c4c;
padding: 2px 4px 3px 7px;
border-radius: 4px 0 0 4px;
@olafdietsche
olafdietsche / fiddle.css
Last active August 29, 2015 14:01
Web: Input field with background image to the right
.valid {
background-image: url(http://lorempixel.com/20/20);
background-repeat: no-repeat;
background-position: right center;
padding-right: 25px;
}
@olafdietsche
olafdietsche / fiddle.js
Last active November 24, 2020 03:36
Javascript: get localStorage maximum size
if (!localStorage) {
console.log('unavailable');
} else {
var max = 'x', s;
var lower_bound = 1, upper_bound = 1, middle;
// determine lower and upper bound
try {
while (true) {
localStorage.setItem('test', max);