Skip to content

Instantly share code, notes, and snippets.

View bastianallgeier's full-sized avatar
🎯
Focusing

Bastian Allgeier bastianallgeier

🎯
Focusing
View GitHub Profile
<html>
<head>
<title>MouseContext</title>
</head>
<body>
<div class="box">
<div class="context">
var MouseContext = new Class({
Implements : Options,
options : {
contextClass : '.context',
delay : 300
},
initialize : function(elements, options) {
this.setOptions(options);
this.elements = elements;
var self = this;
body { text-rendering: optimizeLegibility; }
<?php $hsl = rand(0, 240) . ',' . rand(50, 80) . '%,60%'; ?>
<style type="text/css">
a {
color: hsl(<?php echo $hsl ?>);
}
</style>
<?php
/*
*
* Copyright by Pete Warden: http://petewarden.typepad.com/searchbrowser/2008/06/how-to-post-an.html
* Adapted by Bastian Allgeier: http://bastian-allgeier.de
*
*/
function async($url, $params) {
@bastianallgeier
bastianallgeier / Zootool Post Url.txt
Created April 8, 2011 14:45
Replace the {...} pieces with your own values and you are ready to go…
http://zootool.com/post/?url={url}&title={title}&description={description}&tags={tags}
@bastianallgeier
bastianallgeier / images.css
Created July 26, 2011 07:31
Mark Images without width or height attributes during development
img:not([width]):not([height]) {
border: 2px solid red !important;
}
<html class="no-js">
<head>
...
<script>
document.documentElement.className =
document.documentElement.className.replace("no-js", "js");
</script>
@bastianallgeier
bastianallgeier / loaded.css
Created December 2, 2011 10:57
I'd love to have a :loaded pseudo selector in css, which makes it possible to style elements when they are actually loaded – like images, iframes or the entire document
img {
opacity: 0;
-webkit-transition: opacity .2s;
-moz-transition: opacity .2s;
-o-transition: opacity .2s;
transition: opacity .2s;
}
img:loaded {
opacity: 1;
<?
$myimageURL = $pages->find('projects')->children()->last()->images()->findByExtension('jpg')->first()->url()
/*
I break that down a bit:
- find the page with the uri projects
- get all children of that page